:relfileprefix: ../../../
[#B8CDFB5A906A7ADAB37C78E7B3733CFFE09CA045]

= Function url_view_base::scheme_id

pass:v,q[Return the scheme]


== Synopsis

Declared in header `</boost/url/url_view_base.hpp#L424[boost/url/url_view_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/scheme.adoc[scheme]
scheme_id() const noexcept;
----

== Description

pass:v,q[This function returns a value which] pass:v,q[depends on the scheme in the url:]

* pass:v,q[If the scheme is a well-known]
pass:v,q[scheme, corresponding value from]
pass:v,q[the enumeration]
xref:boost/urls/scheme.adoc[urls::scheme]
pass:v,q[is returned.]

* pass:v,q[If a scheme is present but is not]
pass:v,q[a well-known scheme, the value]
pass:v,q[returned is]
xref:boost/urls/scheme/unknown.adoc[urls::scheme::unknown.]

* pass:v,q[Otherwise, if the scheme is absent]
pass:v,q[the value returned is]
xref:boost/urls/scheme/none.adoc[urls::scheme::none.]

=== Example
[,cpp]
----
assert( url_view( "wss://www.example.com/crypto.cgi" ).scheme_id() == scheme::wss );
----

=== Complexity
pass:v,q[Constant.]

=== Exception Safety
pass:v,q[Throws nothing.]

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

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

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

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3.1. Scheme (rfc3986)]



== Return Value

* `scheme` 




