Hello Jeroen,

2009/11/10 Jeroen Habraken <[email protected]>

> Hi,
>
> I've been looking at cpp-netlib and it's great to finally see a
> library focussing on the network side, and HTTP in specific. I was
> wondering though if any of the current URI parsing implementations can
> be used to parse the query-string of a URI into a map ?
>
>
Yeah this should certainly be possible but at the moment we're still working
on the implementation so as yet, no working URI code.  If you're interested
and you have any suggestions you can contribute to the discussions on the
wiki:

http://sourceforge.net/apps/trac/cpp-netlib/wiki/URIAPIRequirements

I don't know yet, but I imagine something similar to:

namespace bn = boost::network;
bn::http::uri instance("http://example.com/?foo=bar&x=y";)
std::string scheme, host, path;
std::map<std::string, std::string> query_params;
instance >> bn::scheme(scheme)
         >> bn::host(host)
         >> bn::path(path)
         >> bn::query(query_params);
assert(scheme == "http");
assert(host == "example.com");
assert(path == "/");
assert(query_params["foo"] == "bar");
assert(query_params["x"] == "y");


Regards,
Glyn
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel

Reply via email to