#put

4 bookmarks tagged with #put · RSS Feed · ← All Tags

PUT vs POST in RESTful Web Service « vincenthome’s Tech Clips

http://vincenthomedev.wordpress.com/2008/12/18/put-vs-post-in-restful-web-service
"This explains when to use POST or PUT for creating new resources. The answer ultimately lies in who is responsible for determining the new resource’s URI. If the client is in charge, the client can use PUT to the new URI (like we did for user accounts) and the service can return a response code of 201 (“Created”). However, if the service is in charge of generating the new URI, the client should POST the new resource to a factory URI like we’ve done for bookmarks. Then, the service can return a response code of 201 (“Created”) along with the URI of the new resource in the response “Location” header."