|GET||Puts request parameters in the URL as query string parameters.|
|PUT/DELETE||Puts request parameters in the body of the HTTP request.|
|POST||Like PUT and DELETE, except when you go 'back' in your browser to a page that resulted from a POST request, the browser will ask you if you want to resend the request.|
Stephan van Hulst wrote:
Idempotence is achieved by application layer code in the server. It's possible to write idempotent code to handle a POST request, and it's possible to write code that isn't to handle a PUT request. It will be very confusing to a client of your application though.
Stephan van Hulst wrote:On the other hand, in my old student apartment we had an application in which we registered who cooked dinner on what day, and who would be joining dinner. You could uniquely identify a dinner by date, so creating a new dinner record would be done using a PUT request, because you send the date (the ID of the dinner) in the creation request.
Sending a POST to a certain address may trigger a completely different action than sending a PUT.
Arun Singh Raaj wrote:What makes the PUT better choice over POST in this case?
Could you please clear this by providing an example?