Content-Location

When a server selects a specific representation through content negotiation, the Content-Location response header indicates a direct URL for that representation.

Table of Contents

Usage

The Content-Location header provides a URL identifying the particular representation of a resource delivered in the response body. Unlike the Location header, which redirects the client to a different resource, Content-Location points to the exact representation the server chose after content negotiation.

When a server supports multiple representations of the same resource (different languages, formats, or encodings), the Content-Location header tells the client which specific variant was selected. This distinction matters for Caching and bookmarking the negotiated result.

The value is either an absolute URL or a relative reference resolved against the request URL. A relative reference is more common in practice.

Content-Location also appears in responses to PUT and POST requests. After a successful POST creates a new resource, the server sets Content-Location to the URL of the newly created item when the response body represents the created resource directly.

Example

A client requests a document at /report and the server selects the English PDF variant through content negotiation. The Content-Location header identifies the specific URL of the chosen representation.

GET /report HTTP/1.1
Host: example.re
Accept: application/pdf
Accept-Language: en
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Language: en
Content-Location: /report/en.pdf

After a POST request creates a new resource, the server returns the created item in the response body. The Content-Location header points to the canonical URL for the new resource.

HTTP/1.1 201 Created
Content-Type: application/json
Content-Location: /orders/12345

Note

The Location header redirects the client to a different resource, changing the request target. Content-Location identifies the specific URL of the representation already delivered in the response body. Location triggers a new request; Content-Location describes what was returned.

See also

Last updated: April 4, 2026