🔌REST API
Also known as REST, RESTful API, Representational State Transfer
A web API where each thing has its own address, and HTTP methods act on it.
Think of it like
Think of it like a library. Each book has its own shelf number.
Example
Why it matters
Most public web APIs follow REST. Learn it once and you can use thousands of them.
Definition
Example code
http
GET /books/7 HTTP/1.1
Host: api.example.com
Accept: application/jsonCommon mistake
Key takeaways
- 1Things have addresses. Called resources.
- 2Methods are the verbs. GET, POST, PUT, DELETE.
- 3No memory between calls. Each request stands alone.