|
From: Dean M. B. <mik...@gm...> - 2011-01-28 04:46:26
|
On Fri, Jan 28, 2011 at 9:35 AM, David Hite <dav...@gm...> wrote:
> My question is that I have been using stock_reply for the response and am
> wondering if there are other methods for sending messages.
>
> The line I have been using is:
> "response = Server::response::stock_reply(ok, msg);"
> In all the examples I see and also looking through the code all I can find
> is the "stock_reply" method.
If you look at the code in the libs/network/test/hello_world.cpp -- or
there abouts I don't have the directory handy at the moment -- you
should see something like this:
response << header("Content-Type", "application/octet-stream")
<< header("Connection", "close");
What that actually means is you're pushing in HTTP headers into the
response. It's the same if you intend to push in the body of the
response as well:
response << body("The quick brown fox jumps over the lazy dog.");
You can find information about this in the documentation for the HTTP
Response in the library:
http://cpp-netlib.github.com/reference_http_response.html
HTH
--
Dean Michael Berris
about.me/deanberris
|