Skip to content

Instantly share code, notes, and snippets.

@ParadoxV5
Created September 5, 2022 03:10
Show Gist options
  • Save ParadoxV5/17a47ce3956e90390dc19dc8cab06988 to your computer and use it in GitHub Desktop.
Save ParadoxV5/17a47ce3956e90390dc19dc8cab06988 to your computer and use it in GitHub Desktop.
REST study notes

REpresentational State Transfer

a fancy name for the CRUD support of a (web) server

  • for the client-server model
    • implemented by typically web servers though HTTP(S), with data formatted in HTML, JSON or etc.
  • treats server resources as OOP-style objects that can be CRUDed
    • a resource object can be a single item or a collection (as in OOP)
    • use client-side cache and server-side resources, not suspensive states (as with a “State Diagram”)

REST over HTTP(S)

HTTP methods used in REST

HTTP method CRUD action
GET Read this resource item or (entire) collection
POST Create (i.e., add) a new item to this resource collection
PUT Update this resource item or (entire) collection
DELETE Delete this resource item or (entire) collection

Other HTTP methods

HTTP method action
HEAD GET with no response body
PATCH Update partially
OPTIONS list the supported HTTP methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment