boost::urls::url_view_base::scheme :: Boost Libraries Documentation

# boost::urls::url_view_base::scheme

Return the scheme

## Synopsis

Declared in `<boost/url/url_view_base.hpp>`

    core::string_view
    scheme() const noexcept;

## Description

This function returns the scheme if it exists, without a trailing colon (':'). Otherwise it returns an empty string. Note that schemes are case‐insensitive, and the canonical form is lowercased.

## Example

    assert( url_view( "http://www.example.com" ).scheme() == "http" );

## Exception Safety

Throws nothing.

## BNF

    scheme          = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

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

    absolute-URI    = scheme ":" hier-part [ "?" query ]

## Specification

- 3.1. Scheme (rfc3986)

## Return Value

The scheme as a string.

## See Also

`has_scheme`, `scheme_id`.

Created with MrDocs