title: POCO json POST_METHOD returns results but gives I/O exception and ends program
body: <p>Hi im havng a problem with poco under linux, im making a https json post to a webserver and im getting the response as i expected.
  The problem is that i get an error after the response is printed and it ends the execution of my program.</p>
  
  <p>Here is what i get on console:</p>
  
  <pre><code>200 OK
  
  "{\"test_results\": ["result1", "result2", "result3", "result4"]}"
  
  terminate called after throwing an instance of 'Poco::IOException'  what():  I/O error
  </code></pre>
  
  <p>Here is the code that make the above result to be printed:</p>
  
  <pre><code>int posTry(){
  try
    {
      // prepare session
      Poco::Net::Context::Ptr context = new Poco::Net::Context(Poco::Net::Context::CLIENT_USE, "", "", "", Poco::Net::Context::VERIFY_NONE, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
  
      Poco::URI uri("https://someURL/somePATH");
      Poco::Net::HTTPSClientSession session(uri.getHost(), uri.getPort(), context);
  
      // prepare path
      std::string path(uri.getPathAndQuery());
      if (path.empty()) path = "/";
  
      // send request
      std::string test = "{Some json code to get results that is already working}";
  
      Poco::Net::HTTPRequest req(Poco::Net::HTTPRequest::HTTP_POST, path, Poco::Net::HTTPMessage::HTTP_1_1);
      req.setContentType("application/json");
      req.setKeepAlive(true);
      req.setContentLength( test.length() );
  
      session.sendRequest(req) &lt;&lt; test;
  
      // get response
      Poco::Net::HTTPResponse res;
      std::cout &lt;&lt; res.getStatus() &lt;&lt; " " &lt;&lt; res.getReason() &lt;&lt; std::endl;
  
      // print response
      std::istream &amp;is = session.receiveResponse(res);
      Poco::StreamCopier::copyStream(is, std::cout);
      std::vector&lt;Poco::Net::HTTPCookie&gt; cookies;
      res.getCookies( cookies );
    }
  catch( const Poco::Exception&amp; e )
      {
          std::cerr &lt;&lt; e.displayText() &lt;&lt; std::endl;
      }
    catch (...)
      {
        std::cout &lt;&lt; "error";
        return -1;
      }
  
    return 0;
  }
  </code></pre>
  
  <p>I don't know what is this error about and I can't even catch the error in (...) and make the program continue. Can someone help me?</p>