|
From: Dean M. B. <mik...@gm...> - 2011-01-29 13:33:54
|
On Sat, Jan 29, 2011 at 7:08 AM, David Hite <dav...@gm...> 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
|