On Sat, Jan 29, 2011 at 7:08 AM, David Hite <[email protected]> wrote:
>
>>
>> response << Server::response::body(buffer);
>>

This should just be:

    namespace http = boost::network::http;
    response << http::body(buffer);

>
> However, now I have the problem that response.content is a string. How do I
> send binary data, such as an image file?
>

The way I would do it is to somehow mmap the file, get the mmap'ed
pointer, and copy the data into response.content directly. Binary data
is held fine by std::string instances, you just have to reserve the
appropriate amount of memory when you're doing that.

HTH

-- 
Dean Michael Berris
about.me/deanberris

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel

Reply via email to