render_uri_templates {csvwr}R Documentation

Render URI templates

Description

Interpolate variable bindings into a URI template.

Usage

render_uri_templates(templates, bindings = NULL, ...)

Arguments

templates

a character vector with URI templates

bindings

a list of variable bindings to be interpolated into templates

...

further bindings specified as named function arguments

Details

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.

Value

a character vector with the expanded URI

Examples

render_uri_templates("{+url}/resource?query=value", list(url="http://example.net"))
render_uri_templates("{+url}", url="http://example.net")

[Package csvwr version 0.1.7 Index]