I can create users using POST without specifying a URI, and this will create a user and return a URI OR I can create users using PUT and specify the URI itself .
When should you use another?
Use the first one.
In RESTful HTTP, the client should never create a URI. The service must be well connected, which means that the client should always only execute the URIs specified by the server and request these URIs.
It creates a better separation between client and server and makes it easy to make changes to the service without breaking existing clients.
(And yes, many existing APIs are wrong)
There's a really good Fielding article related to this topic here:
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
source share