Interpolate variable bindings into a URI template.
render_uri_templates(templates, bindings = NULL, ...)
a character vector with URI templates
a list of variable bindings to be interpolated into templates
further bindings specified as named function arguments
a character vector with the expanded URI
This doesn't yet implement the whole of RFC 6570, just enough to make the tests pass
You can bind variables by passing a list to the explicit bindings
argument,
or variadically with ...
by naming arguments according to the variable name you wish to bind.
render_uri_templates("{+url}/resource?query=value", list(url="http://example.net"))
#> [1] "http://example.net/resource?query=value"
render_uri_templates("{+url}", url="http://example.net")
#> [1] "http://example.net"