HTTP Methods Reference

HTTP methods define the operation a client performs on a resource. This table covers 9 standard methods with safe/idempotent flags, request body and typical use.

MethodSafeIdempotentBodyDescription
GETYesYesNoRetrieve a representation; safe, idempotent, cacheable.
HEADYesYesNoLike GET but no body; used to inspect headers only.
POSTNoNoYesSubmit data to process; usually creates a sub-resource. Not safe/idempotent.
PUTNoYesYesReplace the entire resource with the payload. Idempotent.
PATCHNoNoYesApply partial modifications to a resource. Not idempotent.
DELETENoYesOptionalDelete the resource. Idempotent.
OPTIONSYesYesNoDescribe communication options; used in CORS preflight.
CONNECTNoNoNoEstablish a tunnel to the server (e.g. HTTPS via proxy).
TRACEYesYesNoEcho the request for diagnostics; often disabled for security.

Frequently Asked Questions

What is the difference between GET and POST?

GET retrieves a resource with params in the URL; it is safe, idempotent and cacheable. POST submits data in the body; it is neither safe nor idempotent and is not cached by default.

What is the difference between PUT and PATCH?

PUT replaces the entire target resource with the full representation (idempotent). PATCH applies partial changes with only the fields to modify (not idempotent).

What does idempotent mean?

Making the same request once or many times results in the same final server state. GET/PUT/DELETE are idempotent; POST/PATCH are not. Idempotence lets clients safely retry after a timeout.

What is the OPTIONS method for?

It returns the HTTP methods a resource supports. Its most common use is the CORS preflight request that browsers send automatically before a cross-origin request.