From: Dean M. B. <mik...@gm...> - 2011-01-11 03:36:02
|
On Tue, Jan 11, 2011 at 5:40 AM, David Hite <dav...@gm...> wrote: > Hey Dean, > Thanks for the quick reply. You're welcome. :) > I can't find the example you are talking about... i'm using 0.8 version. > Ah, yes, the example is only in 0.9-devel at the moment and will be coming out in 0.9 (beta coming within the week). > I'm also getting some compile errors when I try to push the content-type > header on the response.headers > > Here's my code: > > Server::response_header content_type = {"Content-Type", > "application/vnd.google-earth.kml+xml"}; > > // set message in response > response = Server::response::stock_reply(Server::response::ok, > kml_string); > > // set MIME type for response > response.headers.push_back( content_type ); > > And here's my error: > > error: no matching function for call to > 'std::vector<boost::network::http::request_header<boost::network::http::tags::http_server>, > std::allocator<boost::network::http::request_header<boost::network::http::tags::http_server> >> >>::push_back(boost::network::http::response_header<boost::network::http::tags::http_server>&)' > /usr/include/c++/4.4/bits/stl_vector.h:733: note: candidates are: void > std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = > boost::network::http::request_header<boost::network::http::tags::http_server>, > _Alloc = > std::allocator<boost::network::http::request_header<boost::network::http::tags::http_server> >>] > > These error messages are impossible to decipher... any ideas? Ah, it actually just says that you can't push a `response_header<...>` into a vector of `request_header<...>`. I remember this being something I fixed in the 0.9-devel branch and which is an oversight on my part in 0.8. > The only candidate function it's listing is using > boost::network::http::request_header. I tried that too and no dice. > Code like this should work: boost::network::http::request_header<boost::network::tags::http_server> content_type = {"Content-Type", "application/vnd.google-earth.kml+xml"}; response.push_back(content_type); If that still doesn't work, let me know because that would be a serious problem. Have a good one and I hope this helps. (Also, please try not to top-post :D) -- Dean Michael Berris about.me/deanberris |