reparse_url: Parse and re-parse while only scheme and path

View source: R/httr.R

reparse_urlR Documentation

Parse and re-parse while only scheme and path

Description

Parses the given URL and continuously parses the resulting path so long as the result is only a scheme and path. This occurs for nested schemes. The final URL accumulates the scheme as a character vector with super- to sub-scheme ordering.

Usage

reparse_url(x)

Arguments

x

URL to parse for components.

Details

The implementation repeatedly parses, that is re-parses, while non-NULL URL components result in only a scheme-path pair. Note that URLs carry NULL values for non-existent URL components.

Value

URL components with vectorised nested scheme.

Examples

url <- canny.tudor::reparse_url("superscheme:subscheme://host/path")
url$scheme
# [1] "superscheme" "subscheme"

royratcliffe/canny.tudor documentation built on Oct. 17, 2022, 4:17 a.m.