Dav/Devs Footer Logo Dav/Devs

REST API Learning Notes

REST API Learning Notes

REST API Architecture

REST API Architecture

HTTP VerbEntire Collection (Example: customers)Specific Item (Example: customer/[id])
GET200 (Ok), list of customers. Use pagination, sorting and filtering to navigate big lists.200 (Ok) single customer. 404 (Not Found), if ID is not found or invalid.
PUT/PATCH404 (Not Founc), unless you want to update/replace every resource in the entire collection.200 (Ok) or 204 (No Content). 404 (Not Found), if ID is not found or invalid.
POST201 (Created). “Location” header with link to /customer/[id] containing new ID.404 (Not Found).
DELETE404 (Not Found), unless you want to delete the whole collection–not often desirable.200 (Ok). 404 (Not Found), if ID is not found or invalid.

Back to articles