When do you use GET, POST, PUT, PATCH and DELETE?
Short answer
GET reads, POST creates or triggers processing, PUT replaces the whole resource, PATCH changes part of it, DELETE removes it. Pick the method by its semantics, because caches, proxies, retries and browsers all rely on it.
3 points to say:
- GET, PUT, DELETE are idempotent; POST is not.
- Search uses GET + query params so it can be cached and bookmarked; switch to POST only when filters are too complex or the URL too long.
- Anything with a side effect (like starting an export job) is never a GET.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.