Skip to content

Issue with "Content-Location": for 201 Created, use Location instead #10809

@stiiin

Description

@stiiin

MDN URL: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Location

What information was incorrect, unhelpful, or incomplete?

Content-Location is used for content negotiation purposes, meaning "you can find the same content of this response at this other URL". However, one of the examples in this article shows a 201 Created response using this header to mean "you can find the created resource at this other URL".

The article about the Location header explicitly points out 201 as of the statuses where the Location header has meaning, and summarises the difference as follows (though the wording is a bit cryptic):

Location is a header associated with the response, while Content-Location is associated with the entity returned.

Specific section or headline?

Pointing to a new document (HTTP 201 Created)

What did you expect to see?

I expected this example to be on the article about Location instead, and optionally a caveat in the Content-Location article that you should use Location for this purpose.

Did you test this? If so, how?

I did not test this.

MDN Content page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions