Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2021-10-13 14:54:44


On Tue, Oct 12, 2021 at 11:24 PM Julien Blanc via Boost
<boost_at_[hidden]> wrote:
> However, that seems inconsistent with the way set_host works (the docs
> says it needs to be encoded), so i tend to agree with the red flag here
> (or maybe they're just documentation issues, since there is also
> set_encoded_host).

Probably doc issue, there are two functions:

    url::set_host( string_view )
    url::set_encoded_host( string_view )

As with all the APIs, functions with "set_encoded" in the name, accept
a percent-encoded string and throw an exception on invalid input.
"set_host" will apply percent-encoding to the input as needed.

> And then there's the issue of the '/' character in
> set_path if you take unencoded strings (not sure how this should be
> handled...)

Well, there's not much of an issue there. set_path() treats slashes as
segment separators. If that's not what you want, you can set the
individual unencoded segments through the container returned by
url::segments(). The same goes for the query parameters (call
url::params()).

Thanks


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk