Content-Location

When a server selects a specific representation through content negotiation, the Content-Location representation header indicates a direct URL for that representation. In a request, the header states where the sender originally obtained the enclosed content.

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
Location: /orders/12345
Content-Location: /orders/12345

Matching Location and Content-Location values state the body is the current representation of the newly created resource.

See also

Last updated: August 17, 2026