24 Aug
2010
24 Aug
'10
10:38 p.m.
Hi all. I copied the boost::asio HTTP client example code: http://live.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/http/clien... and just replaced the argv stuff with a hard-coded domain name and "index.html". It appears to make the socket connection OK, but the response to the request is 400 ("bad request"). Is there something wrong with this request? boost::asio::streambuf request; std::ostream request_stream(&request); request_stream << "GET " << "index.html" << " HTTP/1.0\r\n"; request_stream << "Host: " << "musicobsession.com" << "\r\n"; request_stream << "Accept: */*\r\n"; request_stream << "Connection: close\r\n\r\n"; It doesn't matter what host I use (as long is it's real). Thanks for any insight!