Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

url_build

Build and parse URLs


Description

Build and parse URLs

Usage

url_build(url, path = NULL, query = NULL)

url_parse(url)

Arguments

url

(character) a url, length 1

path

(character) a path, length 1

query

(list) a named list of query parameters

Value

url_build returns a character string URL; url_parse returns a list with URL components

Examples

url_build("https://httpbin.org")
url_build("https://httpbin.org", "get")
url_build("https://httpbin.org", "post")
url_build("https://httpbin.org", "get", list(foo = "bar"))

url_parse("httpbin.org")
url_parse("http://httpbin.org")
url_parse(url = "https://httpbin.org")
url_parse("https://httpbin.org/get")
url_parse("https://httpbin.org/get?foo=bar")
url_parse("https://httpbin.org/get?foo=bar&stuff=things")
url_parse("https://httpbin.org/get?foo=bar&stuff=things[]")

crul

HTTP Client

v1.1.0
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.