HTTP Methods

The HTTP methods of an endpoint define the type of action it performs on a given resource. Some common HTTP methods are GET, POST, DELETE, and PATCH. It provides the HTTP method for every endpoint. HTTP methods include:

  • GET: Used for retrieving resources.
  • POST: Used for creating a new resource.
  • PATCH: Used for updating properties of resources.
  • PUT: Used for replacing resources or collections of resources.
  • DELETE: Used for deleting resources.

📘

Difference Between PATCH and PUT

PATCH: requests are used to make partial updates on a resource.

PUT: requests are used to modify/replace all resource entities.


The table below summarises the use of HTTP methods discussed above


HTTP MethodsCRUDDescription
POSTCreateIt submits data to the server and the server processes it, creating a new resource.
GETReadIt requests data from the server without modifying it.
PATCHPartial Update/ModifyIt modifies the fields that are provided in the request body.
PUTUpdate/ReplaceThe entire resource is typically replaced with the new data sent in the request body
DELETEDeleteIt requests the server to remove the specified resource