HTTP methods are used to specify the type of action that the client wants to perform on a resource on the server.

<aside> 💡 You done NEED to use all the methods, but you always should. You can do everything you want with a GET or POST method, but it is usually advisable to use them right.

</aside>

Common methods

  1. GET - Retrieve data from a server. (Get my TODOS)
  2. POST - Submit data to be processed by a server. (Create a TODO)
  3. PUT - Update or create a resource on the server (Update my todo)
  4. DELETE - Remove a resource from the server. (Delete my todo)

image.png

🔹 Common HTTP Methods

Method Description
GET Retrieves data from the server. (Safe and idempotent)
POST Submits data to the server to create a resource. (Not idempotent)
PUT Replaces the entire resource with new data. (Idempotent)
PATCH Partially updates a resource. (Not necessarily idempotent)
DELETE Deletes the specified resource. (Idempotent)
HEAD Same as GET but only returns headers (no body).
OPTIONS
CONNECT Establishes a tunnel to the server (used in HTTPS).
TRACE

The OPTIONS method is used to ask the server what it allows — like a preflight check.

It’s mostly used:

🧭 What is the TRACE HTTP Method?