http-method

What is the HTTP method PURGE?

淺唱寂寞╮ 提交于 2020-05-10 06:54:14
问题 Today when using Postman I noticed the method option of PURGE . I have never encountered it in practice and cannot find the explanation of it's purpose. What is this method used for, where did it come from, and is there a spec for it somewhere? 回答1: There is an HTTP PURGE method, though it is not defined in the HTTP RFCs (which do allow for custom methods beyond the standard defined methods). Some HTTP servers and caching systems actually do implement PURGE , for instance Squid and Varnish:

What are practical use-cases for the HTTP verb REPORT and why is it neglected over time?

安稳与你 提交于 2020-03-18 03:52:27
问题 Whenever I have to create a RESTful web service and the use case implies on getting data based on a set of search criteria, I always opted for a POST request with the parameters in the body instead of a GET request for all the obvious reasons. I've seen it a dozen of times so I figured is was best practice. Most recently I stumbled upon this interesting blog article by Evert Pot where he comments on the downsides of the POST verb and simply notes on using the REPORT verb instead. He also

Create HTTP.PATCH request to firebase from JAVA Spring

三世轮回 提交于 2020-01-17 04:52:07
问题 Problem is that the Java HTTPUrlConnection does not support HTTP.PATCH. So I found a guide that did an implementation of delete with with a body. But I'm receiving HTTP/1.1 400 Bad Request I arrived at this: * Import compile("org.apache.httpcomponents:httpclient:4.3.1") Method: @SneakyThrows public void firebasePatch(final PARAM p) { new TaskRunner() { @Override public void command() throws Throwable { final HttpClient httpClient = new DefaultHttpClient(); HttpConnectionParams

Why Tomcat returns different headers for HEAD and GET requests to my RESTful API?

我怕爱的太早我们不能终老 提交于 2020-01-12 07:01:50
问题 My initial purpose was to verify the HTTP chunked transfer . But accidentally found this inconsistency. The API is designed to return a file to client. I use HEAD and GET methods against it. Different headers are returned. For GET , I get these headers: (This is what I expected.) For HEAD , I get these headers: According to this thread, HEAD and GET SHOULD return identical headers but not necessarily . My question is: If Transfer-Encoding: chunked is used because the file is dynamically fed

Using a custom value for HttpMethod

烈酒焚心 提交于 2020-01-03 15:22:26
问题 I'm using the HttpClient and I need to set a non-standard type for the HttpMethod . Where using HttpWebRequest only expects a string, HttpClient expects an HttpMethod . Enumerating the available values in HttpMethod , I don't see a way to add a custom one. Any thoughts? 回答1: Don't know why I didn't think of trying this before, but I can call new HttpMethod("MYMETHOD"); 回答2: Thank you so much. I tried the weirdest stuff, but i did not see this simple solution :) I try to use CalDAV REST

Spring Framework, enable PUT method

孤街醉人 提交于 2020-01-02 04:41:07
问题 I got a problem with capturing PUT request sent to server. These are my methods: @RequestMapping(method= RequestMethod.GET) public String getCity(@PathVariable(value="cid") String cid, @RequestParam(value="State") Integer state, Model model) { System.out.println("get request"); return "index"; } @RequestMapping(method= RequestMethod.PUT) public String putCity(@PathVariable(value="cid") String cid, @RequestParam(value="State") Integer state, Model model) { System.out.println("put request");

What method should I use for a login (authentication) request?

老子叫甜甜 提交于 2019-12-29 13:37:08
问题 I would like to know which http method I should use when doing a login request, and why? Since this request creates an object (a user session) on the server, I think it should be POST, what do you think? But since the login request should be idempotent, it could be PUT, couldn't it? Same question for a logout request, should I use the DELETE method? 回答1: If your login request is via a user supplying a username and password then a POST is preferable, as details will be sent in the HTTP

Is the HTTP method PURGE idempotent in Varnish?

半城伤御伤魂 提交于 2019-12-29 01:45:17
问题 Is the HTTP verb PURGE idempotent? If I send the same PURGE request twice will I receive 200 the second time? I have a microservice that invalidates a Varnish cache before publishing a message into a rabbit queue. In case of purge failure our need is to just log and continue the execution. The queue consumer has to get the latest status of the resource from the Varnish cache. Will a new purge request (before actually requesting the resource from varnish) from the second microservice return

HTTP method names: upper or lower case?

和自甴很熟 提交于 2019-12-23 08:54:36
问题 This may be a self answering question, but I'm hoping one of you could point me to any resource where it is declared, or can be inferred, whether to use upper or lower case letters when declaring a HTTP method name in HTTP or REST requests. The majority of examples I see put GET, PUT, POST, DELETE, PATCH etc in capital letters, whereas I go on the assumption that HTTP method field names are case insensitive - that is, for example, that "get" is equally as valid as "GET". Traditionally I have

Is There a Table That Shows HTTP Method Support by Browser [duplicate]

老子叫甜甜 提交于 2019-12-23 07:55:09
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Are the PUT, DELETE, HEAD, etc methods available in most web browsers? I've seen lots of stuff that generally say "not all browser support all HTTP methods" etc., but is there a nice table that shows specifically which HTTP methods are support that's broken down by browser? I see this previous question on SO but it's not the answer I'm looking for: Fine Grained rest HTTP verbs browser support 回答1: As of now, all