url_parse {httr2} | R Documentation |
Parse a URL into its component pieces
Description
url_parse()
parses a URL into its component parts, powered by
curl::curl_parse_url()
. The parsing algorithm follows the specifications
detailed in RFC 3986.
Usage
url_parse(url, base_url = NULL)
Arguments
url |
A string containing the URL to parse. |
base_url |
Use this as a parent, if |
Value
An S3 object of class httr2_url
with the following components:
scheme
, hostname
, username
, password
, port
, path
, query
, and
fragment
.
See Also
Other URL manipulation:
url_build()
,
url_modify()
Examples
url_parse("http://google.com/")
url_parse("http://google.com:80/")
url_parse("http://google.com:80/?a=1&b=2")
url_parse("http://username@google.com:80/path;test?a=1&b=2#40")
# You can parse a relative URL if you also provide a base url
url_parse("foo", "http://google.com/bar/")
url_parse("..", "http://google.com/bar/")
[Package httr2 version 1.1.2 Index]