There is a way to iterate through query parts of an uri ?

17 views
Skip to first unread message

s3gmenta...@gmail.com

unread,
May 3, 2018, 12:17:53 AM5/3/18
to The C++ Network Library
for example:

        boost::network::uri::uri instance("http://example.com/?a=b");
        assert(instance.has_query());

        for (auto qit = instance.query_begin(); qit != instance.query_end(); ++qit)
                cout << "key: " << qit.first << "; value: " << qit.second << endl; /* expected output: "key: a; value b" */

Dean Michael Berris

unread,
May 3, 2018, 12:25:09 AM5/3/18
to cpp-n...@googlegroups.com
If you're using the cpp-netlib/uri library, then yes:

https://github.com/cpp-netlib/uri/blob/master/include/network/uri/uri.hpp#L349

If you're using it form cpp-netlib's version of the URI library, we
haven't back-ported the implementation yet. :(

I suspect when Glyn is back from vacation and/or has the time, we
really ought to be able to bring the uri library from cpp-netlib/uri
into the main cpp-netlib repository.
> --
> You received this message because you are subscribed to the Google Groups
> "The C++ Network Library" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cpp-netlib+...@googlegroups.com.
> To post to this group, send email to cpp-n...@googlegroups.com.
> Visit this group at https://groups.google.com/group/cpp-netlib.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages