title: Boost asio read_until exception end of file?
body: <p>I'm trying to send a HTTP request to a server via boost asio. I have the following request that I have created in c++:</p>
  
  <pre><code>static const std::string TEMPLATE_HEADER =
  "POST " + HTTP_PATH + " HTTP/1.1\r\n"
  "Content-Type: application/json\r\n"
  "Host: " + HOST_TAG + "\r\n"
  "{ " + TEMPLATE_BODY + " }\r\n\r\n";
  </code></pre>
  
  <p>The actual request that i am sending on is this:</p>
  
  <pre><code>POST /eikon/authsession/machines/ HTTP/1.1 Content-Type: application/json Host: amers1.am.cp.icp2.mpp.ime.reuters.com:80 { "machineID" : "EP-03A482F1B88A","password" : "PasswordReset","takeESOControl" : "false","deviceID" : "123" }
  </code></pre>
  
  <p>This works when using Postman (a Google Chrome extension), but this doesn't seem to work using boost asio. I do the following (the above HTTP Request is strTemp.</p>
  
  <pre><code>// Write the request to the buffer
  size_t request_length = strTemp.length();
  boost::asio::write(s, boost::asio::buffer(strTemp, request_length));
  
  char reply[max_length];
  
  // When a reply is received ending in the correct tag we are looking for, store it in the response buffer
  boost::asio::streambuf response;
  boost::asio::read_until(s, response, Constants::BRACE_TAG);
  </code></pre>
  
  <p>Where the BRACE_TAG variable = "}" (as the response returned ends with a curly brace.</p>
  
  <p>I get an exception come back that says "Exception: read_until: End of file".</p>
  
  <p>Anyone have an idea what's happening?</p>
  
  <p>Thanks.</p>