Method in REST API: GET, POST, PUT, PATCH & DELETE
A method in REST API, also called an HTTP method or HTTP verb, defines the action a client wants to perform on a resource. Every request sent to a REST API includes an HTTP method that tells the server whether the client wants to retrieve, create, update, or delete data.
If you have worked with Postman, cURL, browser developer tools, or application integrations, you have already used REST API methods. They form the foundation of communication between clients and servers.
Before learning individual methods, it helps to understand What is REST API and how a client interacts with a server using HTTP.
What Is a Method in REST API?
A method in REST API specifies the operation that should be performed on a resource.
A resource can represent almost anything:
- A user account
- A product
- An order
- A document
- A payment
To understand resources in more detail, see Resource in REST API.
For example:
GET /users/123
The method is GET, and the resource is /users/123.
The server interprets the request and returns the appropriate response.
Why HTTP Methods Matter in REST APIs
HTTP methods provide a standard way for clients and servers to communicate.
Because developers across the industry follow the same conventions, it becomes much easier to understand and integrate with new APIs.
Consider an e-commerce application:
- Viewing products uses GET
- Creating an order uses POST
- Updating shipping information uses PATCH or PUT
- Canceling an order uses DELETE
These actions map directly to HTTP methods.
To understand how requests and responses work together, read REST API Request and Response Pair.
You can also learn more about How REST API Related to HTTP.
The 5 Most Important Methods in REST API
GET Method in REST API
The GET method retrieves information from a server.
It is the most commonly used HTTP method and is designed for reading data without modifying it.
Common use cases:
- Fetch all users
- Retrieve product details
- Search records
- Get configuration data
Example:
GET /api/products
This request retrieves a collection of products.
Learn more in the dedicated guide on GET Method in REST API.
POST Method in REST API
The POST method creates a new resource or submits data to the server.
When a client sends a POST request, the server processes the data and typically creates a new resource.
Common use cases:
- Create a user account
- Submit a registration form
- Create an order
- Upload content
Example:
POST /api/orders
This request creates a new order.
Learn more in POST Method in REST API.
PUT Method in REST API
The PUT method updates or completely replaces an existing resource.
When using PUT, clients usually send the full representation of the resource.
Common use cases:
- Replace a user profile
- Update all product details
- Replace a document
Example:
PUT /api/users/123
This request replaces the existing user resource.
Learn more in PUT Method in REST API.
PATCH Method in REST API
The PATCH method partially updates an existing resource.
Unlike PUT, PATCH only modifies specific fields instead of replacing the entire resource.
Common use cases:
- Update an email address
- Change a product price
- Modify account settings
Example:
PATCH /api/products/456
This request updates only selected fields of the product.
Learn more in PATCH Method in REST API.
Pro Tip: PATCH is often preferred for large resources because only the changed fields need to be transmitted. This reduces payload size and network overhead.
DELETE Method in REST API
The DELETE method removes a resource from the server.
After a successful DELETE request, the resource is usually no longer available.
Common use cases:
- Delete user accounts
- Remove products
- Cancel subscriptions
- Delete comments
Example:
DELETE /api/comments/987
This request removes the specified comment.
Learn more in DELETE Method in REST API.
HTTP Methods and CRUD Operations
REST API methods closely align with CRUD operations.
- Create → POST
- Read → GET
- Update → PUT or PATCH
- Delete → DELETE
This mapping makes APIs intuitive for developers and helps maintain consistency across applications.
Real-World Example of REST API Methods
Consider a user management API.
Retrieve a user:
GET /users/123
Create a user:
POST /users
Replace a user:
PUT /users/123
Update only the email address:
PATCH /users/123
Delete a user:
DELETE /users/123
Notice that the resource remains the same (/users/123), while the HTTP method changes the action performed on that resource.
Important Characteristics of REST API Methods
Idempotent Methods
An idempotent request produces the same result regardless of how many times it is executed.
The following methods are generally considered idempotent:
- GET
- PUT
- DELETE
- HEAD
For example, deleting the same resource multiple times does not create multiple deletions.
According to the official HTTP Semantics Specification, idempotent methods are designed so that repeated requests have the same intended effect as a single request.
Safe Methods
Safe methods do not modify server-side resources.
GET is the most common safe method.
For example:
GET /products
The request retrieves data without creating, updating, or deleting anything.
HEAD Method
The HEAD method is similar to GET but returns only response headers without the response body.
It is commonly used to:
- Check resource availability
- Validate caching behavior
- Inspect metadata
Learn more in HEAD Method in REST API.
Related REST API Concepts
Understanding HTTP methods becomes easier when you understand the surrounding REST concepts.
You may also find these guides useful:
- REST API Authorization and Authentication
- Response Header in REST API
- Anatomy of REST API Request
- HTTP Status Message in REST API
- URL vs URI vs URN
- Constraints of REST API
- Tools to See REST API in Action
- Discovery in REST API
For official HTTP specifications, refer to the IETF HTTP Semantics RFC.
FAQs About Methods in REST API
How do I know which method to use?
Choose the method based on the action you want to perform:
- GET for retrieving data
- POST for creating resources
- PUT for full updates
- PATCH for partial updates
- DELETE for removing resources
Following these conventions helps keep APIs predictable and easier to maintain.
Can the same endpoint support multiple methods?
Yes.
For example, the endpoint /users/123 can support:
GET /users/123
PUT /users/123
PATCH /users/123
DELETE /users/123
The endpoint remains the same, while the method determines the operation.
What happens if a method is not supported?
The server typically returns HTTP status code 405 Method Not Allowed.
This indicates that the resource exists, but the requested method is not permitted for that endpoint.
What is the difference between PUT and PATCH?
PUT replaces an entire resource.
PATCH updates only selected fields within a resource.
PATCH is generally more efficient when only a small part of the resource needs to be modified.
Final Thoughts
HTTP methods are one of the most important concepts in REST API design. GET, POST, PUT, PATCH, and DELETE provide a standardized way to perform CRUD operations on resources.
Once you understand how these methods work, reading API documentation, integrating third-party services, and building your own REST APIs becomes significantly easier.
8 free, 100% client-side tools for developers — no signup, no data uploads.
Explore all tools