Set the scheme
Synopsis
Declared in header </boost/url/url_base.hpp#L242[boost/url/url_base.hpp,window=blank_]>
url_base&
set_scheme(string_view s);
Description
The scheme is set to the specified string, which must contain a valid scheme without any trailing colon (':'). Note that schemes are case-insensitive, and the canonical form is lowercased.
Example
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
Complexity
Linear in this->size() + s.size()
.
Exception Safety
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
BNF
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
Specification
Return Value
-
``
Parameters
Name | Type |
---|---|
s |
|