Reputation: 3079
I am used to sending http(s) link value in Location http response header. However there appears to be a new standard that improves on this Location header with a new Link http response header, as described in https://datatracker.ietf.org/doc/html/rfc5988#section-5.
Do both of them address the same problem? If so, when should I use one over the other?
Upvotes: 0
Views: 642
Reputation: 99687
The Location header has a a specific meaning: it should point to the destination of a redirect, or it should point to a newly created resource in conjunction with a 201 Created
response.
The Link
header should be used for other kinds of relationships. The Link header supports many types of relationship, for example:
author
of a resourcestylesheet
that may be used with a resource.collection
that a resource belongs inpredecessor-version
of a resourcenext
page.The full list of these relationship types can be found on the IANA Link Relations page
Upvotes: 1