URI Templates are similar to a macro language with a fixed set of macro definitions: the expression type determines the expansion process.
URI Templates are similar to a macro language with a fixed set of macro definitions: the expression type determines the expansion process.
The default expression type is simple string expansion (Level 1), wherein a single named variable is replaced by its value as a string after pct-encoding any characters not in the set of unreserved URI characters (Section 1.5).
Level 2 templates add the plus ("+") operator, for expansion of values that are allowed to include reserved URI characters (Section 1.5), and the crosshatch ("#") operator for expansion of fragment identifiers.
Level 3 templates allow multiple variables per expression, each separated by a comma, and add more complex operators for dot-prefixed labels, slash-prefixed path segments, semicolon-prefixed path parameters, and the form-style construction of a query syntax consisting of name=value pairs that are separated by an ampersand character.
Static fragment element
Fragment expansion with multiple variables, crosshatch-prefixed (Section 3.2.4)
Fragment expansion with multiple variables, crosshatch-prefixed (Section 3.2.4)
Form-style query continuation (Section 3.2.9)
Form-style query continuation (Section 3.2.9)
Static query parameter element
Form-style query, ampersand-separated (Section 3.2.8)
Form-style query, ampersand-separated (Section 3.2.8)
Reserved string expansion for query parameter
Simple string expansion for query parameter
Static path element
Path segments, slash-prefixed (Section 3.2.6)
Path segments, slash-prefixed (Section 3.2.6)
Level 2 allows reserved string expansion (Section 3.2.3)
Level 2 allows reserved string expansion (Section 3.2.3)
Level 3 allows reserved expansion with multiple variables (Section 3.2.3)
Fragment expansion, crosshatch-prefixed (Section 3.2.4)
Fragment expansion, crosshatch-prefixed (Section 3.2.4)
Level 1 allows string expansion (Section 3.2.2)
Level 1 allows string expansion (Section 3.2.2)
Level 3 allows string expansion with multiple variables (Section 3.2.2)