HTTP methods define the action to be performed on a resource. Here's a breakdown of common methods:

GET 📁

  • Purpose: Retrieve resource data
  • Characteristics: Safe (no side effects), Idempotent (same result on repeated requests)
  • Example: GET /resource HTTP/1.1
  • Status Codes: 200 (OK), 301 (Moved Permanently), 404 (Not Found)
GET_request

POST 📝

  • Purpose: Submit data to the server
  • Characteristics: Not safe, Not idempotent
  • Example: POST /submit-form HTTP/1.1
  • Status Codes: 201 (Created), 204 (No Content), 400 (Bad Request)
POST_submission

PUT 🛠️

  • Purpose: Update existing resource
  • Characteristics: Idempotent, Not safe
  • Example: PUT /update-user HTTP/1.1
  • Status Codes: 200 (OK), 204 (No Content), 400 (Bad Request)
PUT_update

DELETE 🧹

  • Purpose: Remove resource
  • Characteristics: Idempotent, Not safe
  • Example: DELETE /delete-article HTTP/1.1
  • Status Codes: 200 (OK), 204 (No Content), 404 (Not Found)
DELETE_icon

PATCH 📌

  • Purpose: Apply partial updates
  • Characteristics: Not idempotent, Not safe
  • Example: PATCH /modify-profile HTTP/1.1
  • Status Codes: 200 (OK), 204 (No Content), 400 (Bad Request)
PATCH_edit

HEAD 🧐

  • Purpose: Retrieve headers only
  • Characteristics: Safe, Idempotent
  • Example: HEAD /resource HTTP/1.1
  • Status Codes: 200 (OK), 404 (Not Found)
HEAD_request

OPTIONS 📚

  • Purpose: Describe communication options
  • Characteristics: Safe, Idempotent
  • Example: OPTIONS /api-endpoint HTTP/1.1
  • Status Codes: 200 (OK), 405 (Method Not Allowed)
OPTIONS_icon

TRACE 🧭

  • Purpose: Echo the request for debugging
  • Characteristics: Safe, Not idempotent
  • Example: TRACE /debug-path HTTP/1.1
  • Status Codes: 200 (OK), 405 (Method Not Allowed)
TRACE_debug

CONNECT 🔗

  • Purpose: Establish a tunnel to the server
  • Characteristics: Safe, Not idempotent
  • Example: CONNECT example.com:443 HTTP/1.1
  • Status Codes: 200 (OK), 400 (Bad Request)
CONNECT_tunnel

For more practical examples, visit our HTTP Methods Tutorial.