HTTP 201 Created
The request succeeded and a new resource was created, normally returned after POST or PUT.
HTTP 201 CreatedHTTP/1.1 201 Createdstatus 201 created201 Created Location header Meaning
A well-formed 201 includes a Location header with the new resource URL and often the created representation in the body. Clients that expect 200 sometimes treat 201 as an error; check response.ok (any 2xx) instead of === 200.
Common causes
- Normal result of a successful create
- Client code only accepts status 200
- Missing Location header
- Duplicate POST creating two resources on retry
- API returns 201 for an update
⚡ Quick fix
- Treat any 2xx as success (
response.ok) - Return a Location header with 201
- Use idempotency keys to stop duplicate creates
Detailed fix by platform
JavaScript
- javascript
const res = await fetch("/api/items", { method: "POST", body: JSON.stringify(item) }); if (res.status === 201) console.log(res.headers.get("Location"));
How to diagnose
- Location header — Present?
- Client — Accepts 2xx?
- Retry — Creates duplicates?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in HTTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026