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

parse_url

Parse and build urls according to RFC3986.


Description

See https://tools.ietf.org/html/rfc3986 for details of parsing algorithm.

Usage

parse_url(url)

build_url(url)

Arguments

url

For parse_url a character vector (of length 1) to parse into components; for build_url a list of components to turn back into a string.

Value

a list containing:

  • scheme

  • hostname

  • port

  • path

  • params

  • fragment

  • query, a list

  • username

  • password

Examples

parse_url("http://google.com/")
parse_url("http://google.com:80/")
parse_url("http://google.com:80/?a=1&b=2")

url <- parse_url("http://google.com/")
url$scheme <- "https"
url$query <- list(q = "hello")
build_url(url)

httr

Tools for Working with URLs and HTTP

v1.4.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

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