url_query_parse()
parses a query string into a named list;
url_query_build()
builds a query string from a named list.
Usage
url_query_parse(query)
url_query_build(query, .multi = c("error", "comma", "pipe", "explode"))
Arguments
- query
A string, when parsing; a named list when building.
- .multi
Controls what happens when a value is a vector:
"error"
, the default, throws an error."comma"
, separates values with a,
, e.g.?x=1,2
."pipe"
, separates values with a|
, e.g.?x=1|2
."explode"
, turns each element into its own parameter, e.g.?x=1&x=2
If none of these options work for your needs, you can instead supply a function that takes a character vector of argument values and returns a a single string.