Resolve targets and honor anchor context
03Relative targets and anchor values are resolved against the representation URL. The anchor changes the context of the statement, not the target’s base.
This example application does not support an overridden context. It ignores the entire link; it does not silently apply next to /books/chapter3 instead.
Source for this drawing: RFC 8288 · Read RFC section 3.2 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
- URI-reference
- An absolute URI or a relative reference to be resolved against a base.
- anchor
- The Link parameter that changes the resource the statement is about.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
A relative target MUST be resolved using RFC 3986 §5. Any base URI in the message body is not applied to the Link field.
- A relative target MUST be resolved using RFC 3986 §5. Any base URI in the message body is not applied to the Link field.
- Default context is the associated representation’s URL. The optional anchor parameter overrides it, and a relative anchor MUST also be resolved using RFC 3986 §5.
- An application may ignore links containing anchor. If it cannot apply anchor, it MUST NOT process the link while pretending anchor was absent; ignore the entire link.
- The representation can have no available context, such as the RFC’s GET 404 example. Do not assume every response creates an identified context.
Assume GET https://example.com/books/chapter3 returns a representation without a Content-Location override. Target chapter4 resolves to https://example.com/books/chapter4. Anchor ../index independently resolves to https://example.com/index. It does not rebase chapter4 to /chapter4. An HTML base element would not change either resolution for this HTTP field.
Read the RFC section ↗