param_remove: Remove key-value pairs from query strings

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

URLs often have queries associated with them, particularly URLs for APIs, that look like ?key=value&key=value&key=value. param_remove allows you to remove key/value pairs while leaving the rest of the URL intact.

Usage

1
param_remove(urls, keys)

Arguments

urls

a vector of URLs. These should be decoded with url_decode but don't have to have been otherwise processed.

keys

a vector of parameter keys to remove.

Value

the original URLs but with the key/value pairs specified by keys removed. If the original URL is NA, NA will be returned; if a specified key is NA, nothing will be done with it.

See Also

param_set to modify values associated with keys, or param_get to retrieve those values.

Examples

1
2
3
# Remove multiple parameters from a URL
param_remove(urls = "https://en.wikipedia.org/wiki/api.php?action=list&type=query&format=json",
            keys = c("action","format"))


urltools documentation built on May 19, 2017, 10:29 a.m.
Search within the urltools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.