These are my reading notes for Code Fellows
REST = architectural style that the whole internet is built on
"links": [
{"rel":"product","href":"https://adventure-works.com/customers/3", "action":"GET" },
{"rel":"product","href":"https://adventure-works.com/customers/3", "action":"PUT" }
]
https://tim-world.com/orders
While this should be avoided:
https://tim-world.com/make-order
GET - gets a resource at a specific URI
POST - creates a new resource at a specific URI
PUT - creates or replaces/updates the resource at a specific URI
PATCH - partially updates a resource
DELETE - deletes a resource at a specific URI
Common conventions:
(source)
POST created-resources return an HTTP status code of 201. If it is not new, it returns the HTTP status of 200. If there is no result to return, the HTTP status is 204.
Codes:
Consider supporting query strings that specify the maximum number of items to retrieve and a starting offset into the collection. For example:
/orders?limit=25&offset=50
Also consider imposing an upper limit on the number of items returned, to help prevent Denial of Service attacks
(source)
Since our API’s will probably not be static, we should take into account the snowball effect that these changes will have on parties using the API. Using versioning means people using the API can choose to update to the latest version
Types of versioning styles explained here