The body of the request contains all that you need to create the new user. The response includes the
URI to the representation of the user. This is a GET method request, like so: GET /users/123456 .
This requests details of the user with ID 123456.
If you want to update the user, you need to use the PUT method like so: PUT /users/123456 .
And if you want to delete the user, you use the DELETE method, like so: DELETE /users/123456 .
If you want to do a batch delete, it is acceptable to pass all the IDs of the users you want to delete in
the body of a call to DELETE /users . This would be far less chatty than multiple calls to each user's
You might want to get all users in the service like so: GET /users . This call would, of course, be
restricted by security so that only the users that the caller is authorized to view would be returned.
That is all for the user's context. Now you'll look at the follower's . A follower is a user who follows
another user because he is interested in that person's posts.
To get all the followers for a given user, use the GET method, like so:
To create a new follower of a user, you pass the ID of that follower in the body of a request to
POST /users/123456/followers . You can get the details of the follower in one of two ways:
This is an example of how you can represent a resource in two different ways. To delete a follower
of a given user, you can do this:
This action removes user 456789 as a follower of user 123456 but does not actually delete the user.
However, the following deletes the user:
You have read about the followers context. Now you'll look at the topics and posts.
The topics noun and the
You have already seen how to create a user by using the POST method. The same is true when
creating a topic and a post.
To create a topic, use:
To create a post under a topic, use:
Note that you cannot create a post by doing this: