Hi,

On Thu, Feb 4, 2010 at 22:11, Nelson, Erik - 2
<[email protected]> wrote:
>
> On Thursday, February 04, 2010 3:33 PM Jeroen Habraken
> [mailto:[email protected]] wrote:
>
>>There's this,
> http://github.com/mikhailberis/cpp-netlib/blob/0.5/libs/network/example/
> uri.cpp
>>which uses http::uri, but it isn't much. The URI tests might offer some
> insight too,
>>those can be found at
> http://github.com/mikhailberis/cpp-netlib/blob/0.5/libs/network/test/url
> _test.cpp.
>
>
> Okay, I'm playing around with it a little bit... If I use a
> URL like http://localhost:8000/test?arg=5 against the hello_world_server
> example, and in the handler do something like
>
> boost::network::uri::http::uri http_uri(request.uri)
>
> the request.uri is something like "/test?arg=5" and http_uri.valid() is
> false... Is this expected?  I would have guessed that request.uri would
> parse okay.  Is there some support for pulling apart the query string
> (separating the path from the arguments)?
>
> Thanks
>
> Erik
>

I can't reproduce this behaviour with the http::uri parser in netlib
0.5, so I'm uncertain where this goes wrong. I've added the test as a
trivial example of how to use http::uri.

Jeroen
#include <iostream>

#include <boost/network/uri.hpp>

int main(int argc, char** argv) {
    std::string test = "http://localhost:8000/test?arg=5";;

    boost::network::uri::http::uri http_uri(test);
    std::cout << (valid(http_uri) ? "valid" : "invalid") << std::endl;
}
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel

Reply via email to