Skip to content

Instantly share code, notes, and snippets.

@AlyoshaS
Last active August 21, 2018 21:49
Show Gist options
  • Save AlyoshaS/5e6d5f2965ed40838445332181852c1d to your computer and use it in GitHub Desktop.
Save AlyoshaS/5e6d5f2965ed40838445332181852c1d to your computer and use it in GitHub Desktop.

HTTP Methods for Handling Posts

URL Method Operation
/posts POST Create a new post
/posts GET Fetch all posts
/posts/14 GET Fetch post 14
/posts/15 PUT Update post 15
/posts/18 DELETE Delete post 18

Restfull Conventions

URL Method Operation
/ POST Create a record
/ GET Fetch all records
//:id GET Fetch record with given id
//:id PUT Update record with given id
//:id DELETE Delete record with given id

HTTP Methods for Handling Users

URL Method Operation
/users POST Create a new user
/users GET Fetch a list of all users
/users/23 GET Fetch details on user with ID 23
/users/23 PUT Update details on user with ID 23
/users/23 DELETE Delete user with ID 23
URL Method Operation
/users/23/posts POST Create a post associated with User 23
/users/23/posts GET Fetch all posts created by User 23
/users/23/posts/14 GET Fetch post 14 created by User 23
/users/23/posts/15 PUT Update post 15 created by User 23
/users/23/posts/18 DELETE Delete post 18 created by User 23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment