Learn R Programming

csvwr (version 0.1.7)

render_uri_templates: Render URI templates

Description

Interpolate variable bindings into a URI template.

Usage

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

Value

a character vector with the expanded URI

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.

Examples

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

Run the code above in your browser using DataLab