Sponsored
Ad slot is loading...

HTTP Methods Reference

Complete reference for HTTP request methods. Learn GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE. Understand when to use each method for REST APIs.

GET

Retrieve data from server

Safe
Yes (no side effects)
Cacheable
Yes
Request Body
Not typically used

All Methods Summary

GET
Retrieve data from server
Safe
Cache
POST
Create new resource
Unsafe
No-cache
PUT
Update/replace entire resource
Unsafe
No-cache
PATCH
Partial update of resource
Unsafe
No-cache
DELETE
Remove resource
Unsafe
No-cache
HEAD
Get headers only (no body)
Safe
Cache
OPTIONS
Get allowed methods
Safe
No-cache
CONNECT
Establish tunnel connection
Unsafe
No-cache
TRACE
Echo request for debugging
Unsafe
No-cache

REST API Best Practices

GET: Read data, never modify
POST: Create new resource
PUT: Replace entire resource
PATCH: Partial update fields
DELETE: Remove resource
HEAD: Check resource exists

Idempotent Methods

Idempotent: Same request multiple times produces same result. GET, HEAD, OPTIONS, PUT, DELETE are idempotent. POST is NOT idempotent (creates new resource each time). PATCH can be idempotent if designed correctly. Safe: Does not modify server state (GET, HEAD, OPTIONS).
Sponsored
Ad slot is loading...