Questions tagged [http-verbs]

HTTP Verbs represent the request methods that are recognized as part of the Hypertext Transfer Protocol. These include but are not limited to POST, GET , PUT and DELETE.

219 questions
255
votes
10 answers

What is the main difference between PATCH and PUT request?

I am using a PUT request in my Rails application. Now, a new HTTP verb, PATCH has been implemented by browsers. So, I want to know what the main difference between PATCH and PUT requests are, and when we should use one or the other.
user3276063
  • 2,583
  • 2
  • 13
  • 7
79
votes
3 answers

Combine GET and POST request methods in Spring

I have a resource that supports both GET and POST requests. Here a sample code for a sample resource: @RequestMapping(value = "/books", method = RequestMethod.GET) public ModelAndView listBooks(@ModelAttribute("booksFilter") BooksFilter filter, two…
user1120144
60
votes
9 answers

Rails' link_to method: GETing when it should DELETE

I'm following Michael Hartl's Rails Tutorial, and for some reason the following code: <%= link_to 'delete', user, :method => :delete, :confirm => "You sure?", :title => "Delete #{user.name}" %> Issues a GET request…
koggit
  • 613
  • 1
  • 5
  • 6
60
votes
3 answers

Is the HTTP 'HEAD' verb useful in web development?

I've read the w3.org spec on the 'HEAD' verb, and I guess I'm missing something. I can't see how it would be useful. Is the HTTP 'HEAD' verb useful in web development? If so, how?
Dan Esparza
  • 28,047
  • 29
  • 99
  • 127
45
votes
8 answers

How to specify DELETE method in a link or form?

Rfc2616 lists many methods besides GET and POST, like, say, DELETE, PUT etc. Method field in html forms, though, seems to be allowed to specify only GET or POST. Is it possible to create a link or form in a html page that uses a request method that…
36
votes
8 answers

Http verb of current http context

How do you find the http verb (POST,GET,DELETE,PUT) used to access your application? Im looking httpcontext.current but there dosent seem to be any property that gives me the info. Thanks
Tom Squires
  • 8,848
  • 12
  • 46
  • 72
35
votes
10 answers

server error:405 - HTTP verb used to access this page is not allowed

I have a php Facebook application which I have uploaded in a Microsoft server. When I run the application i get this error. Does anybody know the cause of this ? 405 - HTTP verb used to access this page is not allowed. The page you are looking…
Florian Shena
  • 1,384
  • 4
  • 19
  • 27
35
votes
2 answers

Python Requests - Dynamically Pass HTTP Verb

Is there a way to pass an HTTP verb (PATCH/POST) to a function and dynamically use that verb for Python requests? For example, I want this function to take a 'verb' variable which is only called internally and will either = post/patch. def…
HectorOfTroy407
  • 1,737
  • 5
  • 21
  • 31
33
votes
3 answers

Should the PATCH method return all fields of the resource in the response body?

Should the PATCH method return all fields of the resource in the response body? Or should it return only updated fields? I'm reading this For example, if it returns only updated fields, the user could know which fields were updated in the server,…
Nigiri
  • 3,469
  • 6
  • 29
  • 52
29
votes
4 answers

Incrementing resource counter in a RESTful way: PUT vs POST

I have a resource that has a counter. For the sake of example, let's call the resource profile, and the counter is the number of views for that profile. Per the REST wiki, PUT requests should be used for resource creation or modification, and should…
Idan Gazit
  • 2,500
  • 3
  • 20
  • 24
27
votes
1 answer

Using LINK and UNLINK HTTP verbs in a REST API

I am currently working on implementing a REST API. I have a resource model with a large number of relationships between the individual resources. My question is: how do you link two existing resources to each other (establishing a relationship) in…
Jeroen Minnaert
  • 625
  • 1
  • 9
  • 19
23
votes
4 answers

How can I overload ASP.NET MVC Actions based on the accepted HTTP verbs?

Wanted to use the same URL for a GET/PUT/DELETE/POST for a REST based API, but when the only thing different about the Actions is which HTTP verbs it accepts, it considers them to be duplicate! "Type already defines a member called 'Index' with the…
MetaGuru
  • 42,847
  • 67
  • 188
  • 294
21
votes
3 answers

ASP.NET MVC AcceptVerbs and registering routes

do I have to register the HttpVerb constraint in my route definition (when i'm registering routes) if i have decorated my action method with the [AcceptVerbs(..)] attribute already? eg. i have this. [AcceptVerbs(HttpVerbs.Post)] public ActionResult…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
18
votes
6 answers

REST - Modify Part of Resource - PUT or POST

I'm seeing a good bit of hand-waving on the subject of how to update only part of a resource (eg. status indicator) using REST. The options seem to be: Complain that HTTP doesn't have a PATCH or MODIFY command. However, the accepted answer on HTTP…
Jacob Zwiers
  • 1,092
  • 1
  • 13
  • 33
15
votes
1 answer

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

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…
Nico Van Belle
  • 4,911
  • 4
  • 32
  • 49
1
2 3
14 15