expandTemplateURIString

Expands a URI template as defined in RFC 6570.

  1. string expandTemplateURIString(string templateUri, VariableCallback resolveVariable, bool strict)
    @safe
    string
    expandTemplateURIString
    (
    scope return string templateUri
    ,,
    bool strict = false
    )
  2. string expandTemplateURIString(string templateUri, URIVariable[string] variables, bool strict)
  3. string expandTemplateURIString(string templateUri, string[string] variables, bool strict)

Parameters

templateUri string

Given URI template as defined in RFC 6570.

resolveVariable VariableCallback

Callback delegate to resolve a variable name (parameter) to the variable value. (return value) May be called more than once per variable name. See VariableCallback. Values are percent encoded by this function and must not be encoded by the callback function.

Note that all values returned by this function MUST be formed prior to template expansion in order to comply with RFC 6570. Therefore to ensure compatibility a given variable name must always evaluate to the same value every time.

strict bool

Validate entire string strictly according to RFC 6570. Does NOT perform unicode code-point validation. Performs character-by-character checks for exact grammar checks.

Return Value

Type: string

The expanded URI (GC-allocated) or if there is no template in the URI, the templateUri parameter as given.

Throws

TemplateURIFormatException on attempted use of a reserved operator, invalid variable specifications or strict issues.

Meta