title: Get response from Poco http client to string
body: <p>I have a small code that sends a POST HTTP call to a local web service and gets a response, using the Poco library. Currently I have the response message printed in the terminal with cout.</p>
  
  <pre><code>#include "Poco/Net/HTTPClientSession.h"
  #include "Poco/Net/HTTPRequest.h"
  #include "Poco/Net/HTTPResponse.h"
  #include "Poco/StreamCopier.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  using namespace Poco::Net;
  using namespace Poco;
  
  int main (int argc, char* argv[])
  {
      HTTPClientSession s("localhost", 8000);
      HTTPRequest request(HTTPRequest::HTTP_POST, "/test");
      s.sendRequest(request);
  
      HTTPResponse response;
      std::istream&amp; rs = s.receiveResponse(response);
      StreamCopier::copyStream(rs, cout);
  
      return 0;
  }
  </code></pre>
  
  <p>How can I have the response message stored in a char array or string and not printed or stored in a file?</p>