[#02625EEC2B6C30C666A21DF49B2B48C862B021EF]

Function url:: url

Constructor

Synopsis

            url(core::string_view s);
        

Description

This function constructs a URL from the string `s`, which must contain a valid URI or relative-ref or else an exception is thrown. The new url retains ownership by allocating a copy of the passed string.

Example

url u( "https://www.example.com" );

Effects

return url( parse_uri_reference( s ).value() );

Postconditions

this->buffer().data() != s.data()

Complexity

Linear in `s.size()`.

Exception Safety

Calls to allocate may throw. Exceptions thrown on invalid input.

BNF

URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ]

Specification

  • 4.1. URI Reference