On Tue, Aug 24, 2010 at 3:38 PM, G S
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").
OK, it turns out that it doesn't matter what I put as the host. This doesn't return an error: boost::asio::io_service io_service; // Get a list of endpoints corresponding to the server name. tcp::resolver resolver(io_service); tcp::resolver::query query("ksjfkdsjkfjds.com", "http"); tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); tcp::resolver::iterator end; // Try each endpoint until we successfully establish a connection. tcp::socket socket(io_service); boost::system::error_code error = boost::asio::error::host_not_found; while (error && endpoint_iterator != end) { socket.close(); socket.connect(*endpoint_iterator++, error); } What gives?