My reading journal for Code Fellows.
REST stands for Representational State Transfer.
REST APIs are designed around a resource.
A resource identifier is a URI that uniquely identifies that resource. For example: https://adventure-works.com/orders/1
The most commonly used HTTP verbs are GET, POST, PUT, PATCH, and DELETE.
URIs should be based on nouns or the resource itself, not the operations performed on the resource.
A good URI looks like this: https://adventure-works.com/orders
A chatty API is one that exposes a large amount of small resources. This is not good, because it can require a client application to send multiple requests to retrieve all of its required data. This creates extra network traffic, but can be avoided by using properly sized resources that strike a balance between needing to many requests and passing too large of objects.
A successful GET returns 200 (OK).
An unsuccessful GET returns 404 (Not Found).
A successful POST returns 201 (Created) if it created a new resource. If it did not create a new resource, but just did some processing, then it can return 200 (OK) or 204 (No Content) if there is no result to return.
A successful DELETE returns 204 (No Content).
I am interested in learning more about how APIs are created. They serve a very cool function and I think they will continue to grow and be very important in the future of communications technology.