Skip to main content
POSTActive

POST submits data to create a resource or trigger an action. Unlike GET, POST is not safe or idempotent – multiple identical requests may create multiple resources. The server returns 201 Created with a Location header for new resources, or 200 OK for actions.

Properties

SafeNoSafe methods don't change server state. They are read-only.
IdempotentNoIdempotent methods produce the same result if called once or multiple times.
CacheableNoCacheable responses may be stored and reused for equivalent requests.
Request BodyYesWhether a request body is allowed / expected.
Response BodyYesWhether a response body is expected.

Description

The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server. POST is used to create new resources in REST APIs, submit HTML forms, and trigger server-side actions.

Examples

Create a user
http
POST /api/users HTTP/1.1
Host: api.example.com
Content-Type: application/json
Authorization: Bearer <token>

{"name": "Alice", "email": "[email protected]", "role": "editor"}
201 Response
http
HTTP/1.1 201 Created
Location: /api/users/43
Content-Type: application/json

{"id": 43, "name": "Alice"}

Specification

RFC 9110POST method specification →