HTTP methods are used to define the actions that can be performed on resources. Here are the commonly used HTTP methods:
- GET: Retrieve data from a server.
- POST: Send data to the server to create or update a resource.
- PUT: Update a resource on the server.
- DELETE: Remove a resource from the server.
- PATCH: Apply partial modifications to a resource.
For more information on HTTP methods, you can read our detailed guide on HTTP Methods.
Here is a brief overview of each method:
GET: Used to retrieve data. It is safe and idempotent. This means it doesn't change the state of the server, and multiple identical requests have the same effect as one request.
POST: Used to send data to the server to create a new resource. It is not safe and idempotent, meaning it can change the state of the server and multiple identical requests can have different effects.
PUT: Used to update an existing resource. It is idempotent, meaning multiple identical requests will have the same effect as one request.
DELETE: Used to delete a resource from the server. It is idempotent, meaning multiple identical requests will have the same effect as one request.
PATCH: Used to apply partial modifications to a resource. It is idempotent, meaning multiple identical requests will have the same effect as one request.
For further reading on HTTP methods, check out our comprehensive HTTP Methods Guide.