rfc9652v1.txt | rfc9652.txt | |||
---|---|---|---|---|
skipping to change at line 84 ¶ | skipping to change at line 84 ¶ | |||
List, String, Display String, and Parameter. | List, String, Display String, and Parameter. | |||
2. The Link-Template Header Field | 2. The Link-Template Header Field | |||
The Link-Template header field is a Structured Field | The Link-Template header field is a Structured Field | |||
[STRUCTURED-FIELDS] that serializes one or more links into HTTP | [STRUCTURED-FIELDS] that serializes one or more links into HTTP | |||
message metadata. It is semantically equivalent to the Link header | message metadata. It is semantically equivalent to the Link header | |||
field defined in Section 3 of [WEB-LINKING], except that the link | field defined in Section 3 of [WEB-LINKING], except that the link | |||
target and link anchor can contain URI Templates [URI-TEMPLATE]. | target and link anchor can contain URI Templates [URI-TEMPLATE]. | |||
Its value is a List of Strings. Each String is a URI Template, and | The Link-template header field's value is a List of Strings (see | |||
Parameters on it carry associated metadata. | [STRUCTURED-FIELDS]). Each String contains a URI Template and can | |||
have Parameters that carry metadata associated with that template. | ||||
For example: | For example: | |||
Link-Template: "/{username}"; rel="item" | Link-Template: "/{username}"; rel="item" | |||
indicates that a resource with the relation type "item" for a given | indicates that a resource with the relation type "item" for a given | |||
"username" can be found by expanding the "username" variable into the | "username" can be found by expanding the "username" variable into the | |||
template given. | template given. | |||
The link target (as defined in Section 2 of [WEB-LINKING]) is the | The link target (see Section 2 of [WEB-LINKING]) is determined by | |||
result of expanding the URI Template [URI-TEMPLATE] (being converted | expanding the template and converting it to an absolute URI (if | |||
to an absolute URI after expansion, if necessary). | necessary). | |||
The link context and link relation type for the link (as defined in | The link context and link relation type for the link (as defined in | |||
Section 2 of [WEB-LINKING]) are conveyed using the "anchor" and "rel" | Section 2 of [WEB-LINKING]) are conveyed using the 'anchor' and 'rel' | |||
Parameters, as they are for the Link header field in Section 3 of | Parameters, as they are for the Link header field in Section 3 of | |||
[WEB-LINKING]. Their values MUST be Strings. | [WEB-LINKING]. Their values MUST be Strings. | |||
However, the "anchor" Parameter MAY contain a URI Template. For | However, the 'anchor' Parameter MAY contain a URI Template. For | |||
example: | example: | |||
Link-Template: "/books/{book_id}/author"; | Link-Template: "/books/{book_id}/author"; | |||
rel="author"; anchor="#{book_id}" | rel="author"; anchor="#{book_id}" | |||
Here, the link to the author for a particular book in a list of books | Here, the link to the author for a particular book in a list of books | |||
can be found by following the link template. | can be found by following the link template. | |||
This specification defines additional semantics for the "var-base" | This specification defines additional semantics for the 'var-base' | |||
Parameter on templated links; see Section 2.1. | Parameter on templated links; see Section 2.1. | |||
The link's target attributes (as defined in Section 2.2 of | The link's target attributes (as defined in Section 2.2 of | |||
[WEB-LINKING]) are conveyed using other Parameters, in a manner | [WEB-LINKING]) are conveyed using other Parameters, in a manner | |||
similar to the Link header field. These Parameter values MUST be | similar to the Link header field. These Parameter values MUST be | |||
Strings, unless they contain non-ASCII characters, in which case they | Strings, unless they contain non-ASCII characters, in which case they | |||
MUST be Display Strings. Note that some target attribute names will | MUST be Display Strings. Note that some target attribute names will | |||
not serialize as Structured Field Parameter keys (see Section 3.1.2 | not serialize as Structured Field Parameter keys (see Section 3.1.2 | |||
of [STRUCTURED-FIELDS]). | of [STRUCTURED-FIELDS]). | |||
For example: | For example: | |||
Link-Template: "/author"; rel="author"; | Link-Template: "/author"; rel="author"; | |||
title=%"Bj%c3%b6rn J%c3%a4rnsida" | title=%"Bj%c3%b6rn J%c3%a4rnsida" | |||
Implementations MUST support all levels of template defined by | Implementations MUST support all levels of template defined by | |||
[URI-TEMPLATE] in the link String and the anchor Parameter. | [URI-TEMPLATE] in the link String and the 'anchor' Parameter. | |||
2.1. The 'var-base' Parameter | 2.1. The 'var-base' Parameter | |||
When a templated link has a 'var-base' Parameter, its value conveys a | When a templated link has a 'var-base' Parameter, its value conveys a | |||
URI-reference that is used as a base URI for the variable names in | URI-reference that is used as a base URI for the variable names in | |||
the URI Template. This allows template variables to be globally | the URI Template. This allows template variables to be globally | |||
identified, rather than specific to the context of use. | identified, rather than specific to the context of use. | |||
Dereferencing the URI for a particular variable might lead to more | Dereferencing the URI for a particular variable might lead to more | |||
information about the syntax or semantics of that variable; | information about the syntax or semantics of that variable; | |||
End of changes. 6 change blocks. | ||||
9 lines changed or deleted | 10 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. |