News for hackers. Stuff that matters.
Re:Designing a RESTful API That Doesn't Suck by drdaeman on Friday March 22, 2013 @09:53AM (#5422865)
PUT for creating and complete updating, PATCH for partial updates.

POST has no useful semantics (more correctly, its semantics is just like those of "do"/"execute" verb) and should be used only if no other verb matches. Or for compatibility reasons ("POST /foo\nX-HTTP-Method-Override: PUT")

Re:Designing a RESTful API That Doesn't Suck by dragonwriter on Friday March 22, 2013 @12:43PM (#5424020)
> POST has no useful semantics (more correctly, its semantics is just like those of "do"/"execute" verb) and should be used only if no other verb matches.

While POST is often used as a generic "do"/"execute", its actual defined semantics in RFC2616 are for the server to "accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line."

So, aside from fallback uses, its explicitly the correct verb to use for a request that is intended to create a resource where the client doesn't know the identifier of the resource to be created, only its parent. This is particularly likely to be the case anytime the resource to be created is of a kind that will have a server-assigned key that will be part of the URI.

Re:Designing a RESTful API That Doesn't Suck by gnaritas on Friday March 22, 2013 @10:33AM (#5423113)
POST has useful semantics, using PUT requires you know where to put it when the general case is you actually don't, POST for create when you don't know where it goes, the response should then redirect to the created location.