I was reading some documents about the appropriate use of URI's using rest services and I came across an example for basic GET .. DELETE requests.
The example uri's were:
Get all users
GET http://mydomain.org/api/users
Get specific user
GET http://mydomain.org/api/users/1
Update user
PUT http://mydomain.org/api/users/1
DELETE user
DELETE http://mydomain.org/api/users/1
A user resource would be either JSON or XML in the form of:
{
Id: 1,
FirstName: 'John',
LastName: 'Doe'
}
My question is this. To maintain REST principles, is it required to include the id of the resource within the URI for PUT requests?