Boost logo

Boost Users :

Subject: [Boost-users] What is the way to access the data contained in a stream buffer?
From: Ramon F Herrera (ramon_at_[hidden])
Date: 2009-09-12 19:59:47


This is the relevant code:

     boost::asio::streambuf request;
     std::ostream request_stream(&request);
     request_stream << "GET " << argv[2] << " HTTP/1.0\r\n";
     request_stream << "Host: " << argv[1] << "\r\n";
     request_stream << "Accept: */*\r\n";
     request_stream << "Connection: close\r\n\r\n";

     // Send the request.
     boost::asio::write(socket, request);

How can I convert the 'request.data' into a string or something?

TIA,

-Ramon


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net