Learn R Programming

nanonext (version 1.3.0)

parse_url: Parse URL

Description

Parses a character string containing an RFC 3986 compliant URL as per NNG.

Usage

parse_url(url)

Value

A named character vector of length 10, comprising:

  • rawurl - the unparsed URL string.

  • scheme - the URL scheme, such as "http" or "inproc" (always lower case).

  • userinfo - the username and password if supplied in the URL string.

  • host - the full host part of the URL, including the port if present (separated by a colon).

  • hostname - the name of the host.

  • port - the port (if not specified, the default port if defined by the scheme).

  • path - the path, typically used with HTTP or WebSocket.

  • query - the query info (typically following ? in the URL).

  • fragment - used for specifying an anchor, the part after # in a URL.

  • requri - the full Request-URI (path[?query][#fragment]).

Values that cannot be determined are represented by an empty string

''.

Arguments

url

character string containing a URL.

Examples

Run this code
parse_url("https://user:password@w3.org:8080/type/path?q=info#intro")
parse_url("tcp://192.168.0.2:5555")

Run the code above in your browser using DataLab