← REST API Development learning pathREST API Development · Module 2 of 10
HTTP methods
Use GET, POST, PUT, PATCH and DELETE for the right actions.
📖 Key ideas
- GET reads data and should not change anything.
- POST creates a new resource.
- PUT replaces a resource; PATCH updates part of it.
- DELETE removes a resource.
- GET, PUT and DELETE are idempotent: repeating them has the same effect.
💡 Real-life example: HTTP methods are verbs in a sentence: GET (read) the book, POST (add) a book, DELETE (remove) the book.
GETRead data
POSTCreate data
PATCHPartial update
IdempotentRepeating gives the same result