Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.72 KB

README.md

File metadata and controls

28 lines (20 loc) · 1.72 KB

Rest Architecture Cheatsheet

Definitions

REST stands for REpresentational State Transfer. The term was introduced in 2000, in Roy Thomas Fielding's dissertation Architectural Styles and the Design of Network-based Software Architectures.

Hey server, can I tell you something please?

The following table the expected meaning of requests in a restful API for typical use-cases:

Method Path to a specific id, like /printers/{id} Path to a collection, like /printers
GET "Please get me the data for this printer" "Please get me the data for the entire collection of printers"
PUT "Please (over)write this printer with the object I have in body" "Please (over)write this collection of printers with the object I have in body"
POST Don't do it. You post specific items at the collection level "My body contains a printer object. Please add it to the collection. It'd nice if you get back to me with the resulting ID"
DELETE "Please delete this printer" "Please delete the entire collection of printers"
PATCH "Please patch this printer object with the properties I'm sending you in body" Not typically allowed

References

  • RFC 7230 HTTP/1.1 Message Syntax and Routing
  • RFC 7231 HTTP/1.1 Semantics and Content