Hi Erik,
On 9 February 2010 23:52, Nelson, Erik - 2
<[email protected]>wrote:
> Is there any reason I can't send a binary response?
>
> For example, the hello_world_server has
>
> response = server::response::stock_reply(server::response::ok, "Hello,
> World!");
>
> Could I fill a string with binary data and send it like this?
>
> String s("\0\0\0\0\0")
> response = server::response::stock_reply(server::response::ok, s);
>
> and get it out on the client side? If so, would I use
> boost::network::body(response) on the client side, or something else?
>
You'd have to base 64 encode and decode any binary data in HTTP. There's
nothing in cpp-netlib which does this, but you can use:
https://svn.boost.org/trac/boost/browser/trunk/boost/archive/iterators/base64_from_binary.hpp
before copying your data to the message on the server and.
https://svn.boost.org/trac/boost/browser/trunk/boost/archive/iterators/binary_from_base64.hpp
for the client.
HTH,
Glyn
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel