HTTP methods (or verbs) are used to perform operations on resources identified by a URI. Each method has a specific purpose.

Main HTTP Methods Reference

MethodPurposeIdempotent (Same result if called multiple times)Safe (No server side changes)ExampleTypical Use
GET
(Read)
Retrieve data from the server.YesYesGET /users
GET /users/10
* Get all users
* Get user by id
POST
(Create)
Create a new resource.NoNoPOST /users* Create a new user
* Submit form data
PUT
(Update)
Update or replace an existing resource entirely.YesNoPUT /users/10* Update user (full)
* Replace user info
PATCH
(Partial Update)
Partially update an existing resource.YesNoPATCH /users/10* Update user (partial)
* Change single field
DELETE
(Delete)
Delete a resource from the server.YesNoDELETE /users/10* Delete user
* Remove resource
OPTIONS
(Info)
Get information about supported methods.YesYesOPTIONS /users* Get allowed methods
* CORS preflight
HEAD
(Partial Headers)
Similar to GET but returns headers only (no body).YesYesHEAD /users/10* Check resource existence
* Get metadata

Key Properties

Idempotent Methods

  • GET, PUT, DELETE, HEAD, OPTIONS are idempotent.
  • Calling them multiple times produces the same result without additional side effects.

Example: PUT /users/10 with same data 5 times results in the same user data.

Safe Methods

Methods that do not change the state on the server.

Safe Methods: GET, HEAD, OPTIONS


Quick Comparison Matrix

MethodCreateReadUpdateDeleteIdempotentSafe
GET–✓––✓✓
POST✓–––❌❌
PUT––✓–✓❌
PATCH––✓–✓❌
DELETE–––✓✓❌
OPTIONS––––✓✓
HEAD–✓––✓✓

Interview Tip

  • Use the correct HTTP method for the operation.
  • GET should not change data.
  • PUT replaces the entire resource, PATCH updates partially.

Resource

https://www.rfc-editor.org/info/rfc9110/#section-9