Learn how to create REST APIs and be in peace with your mind by knowing how to structure them in a way that will provide an amazing experience for your users and also be easy to maintain and improve
16. the “strange” ones
options
describe communication options
head
same as get, but without fetching the body
Connect
starts a 2-way communication
TRACE
returns the full HTTP request back
17. POST, PUT, PATCH ???
post
creates new resources
put
updates a resource as a whole
patch
updates a resource partially
23. versioning your api
using the url
https://myapi.app/v1/users
https://myapi.app/v2/users
using a subdomain
https://v1.myapi.app/users
https://v2.myapi.app/users
using an http header
x-api-version: 1
x-api-version: 2
24. let your crud rest
post https://myapi.app/v1/posts [201]
GET https://myapi.app/v1/posts [200]
get https://myapi.app/v1/posts/1 [200]
put https://myapi.app/v1/posts/1 [200/204]
patch https://myapi.app/v1/posts/1/publish [200/204]
delete https://myapi.app/v1/posts/1 [204]