What are the main HTTP methods in a REST API?
The main HTTP methods are GET to read data, POST to create something new, PUT to replace an existing resource, PATCH to update part of it, and DELETE to remove it. Each method has a clear meaning, which is why REST APIs are predictable. GET should never change data, while POST, PUT, PATCH, and DELETE do change things.
- GET reads data, POST creates, PUT and PATCH update, and DELETE removes.
- GET and DELETE are idempotent, while POST is not.
- Using the right method makes an API predictable and cache friendly.
What each method means
- GET: fetch a resource, safe and should not change anything.
- POST: create a new resource, often returns the created item.
- PUT: replace a resource fully with the data you send.
- PATCH: update only some fields of a resource.
- DELETE: remove a resource.
GET is called safe because it only reads. GET, PUT, and DELETE are idempotent, meaning calling them many times has the same effect as calling once. POST is not idempotent, so repeating it can create duplicates.
Interviewers love when you connect methods to idempotency. Saying GET is safe and PUT is idempotent but POST is not shows you understand the deeper contract, not just the names.
Frequently asked questions
What is the difference between PUT and POST?
POST creates a new resource and is not idempotent, while PUT replaces a resource at a known URL and is idempotent, giving the same result if repeated.
Should GET requests change data?
No. GET should only read data and have no side effects, which lets responses be cached and requests be retried safely.
Common follow up questions
Related interview questions
Want the full API Design guide?
Read every API Design concept with notes, diagrams, and code in one place. Track your progress as you go.
Open the API Design guide All API Design questions