Location HTTP Origin: Network OSI layer 7 · Application Last updated 18 Nov 2026

201 Created without a Location header (clients can't find the new resource)

The API created a resource but doesn't say where it lives, so clients must guess or re-query.

Exact message you may see 201 without Location headerLocation header missing 201 Createdresponse.headers.get('Location') nullAccess-Control-Expose-Headers Locationcreated resource URL not returned
Seen on: HTTP REST API

Meaning

A 201 should carry Location: /items/42 (absolute or relative) and ideally the representation. Add the header in the create handler, and make sure the proxy doesn't strip it, so clients and HTTP libraries can follow it.

Common causes

  • Create handler returns only a body
  • Location header stripped by a proxy
  • Wrong or relative path built from the internal host
  • Framework helper not used
  • CORS hiding the header from JavaScript

⚡ Quick fix

  1. Return Location: /api/items/42 with 201
  2. Expose it to browsers with Access-Control-Expose-Headers: Location
  3. Use the framework's created() helper

Detailed fix by platform

Express

  1. res.status(201).location(/api/items/${item.id}).json(item);

How to diagnose

  1. Location — Present?
  2. Exposed to CORS — Yes?
  3. URL — Public host?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

102 — HTTP 102 Processing (HTTP)102201 — HTTP 201 Created (HTTP)201202 — HTTP 202 Accepted (HTTP)202203 — HTTP 203 Non-Authoritative Information (HTTP)203204 — HTTP 204 No Content (HTTP)204205 — HTTP 205 Reset Content (HTTP)205Location — Redirect goes to the wrong host, port or scheme (bad Location header) (HTTP)LocationLocation

Explore the map of this error Full error map →

🧠 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.