title: Akka http, GET Http().singleRequest is throwing server closed connection unexpectedly
body: <p>Akka-http version - 10.0.14</p>
  
  <p>Akka version - 2.4.20</p>
  
  <p><strong>Getting below error while using akka http as a client to send GET request and receive the response body.</strong></p>
  
  <p>Exception in thread "main" akka.http.impl.engine.client.OutgoingConnectionBlueprint$UnexpectedConnectionClosureException: The http server closed the connection unexpectedly before delivering responses for 1 outstanding requests</p>
  
  <p>Observation:</p>
  
  <ol>
  <li><p>Same GET call is working through curl command</p></li>
  <li><p>Same client code is working for GET call, '<a href="https://api.xforce.ibmcloud.com/hub/invalidcall" rel="nofollow noreferrer">https://api.xforce.ibmcloud.com/hub/invalidcall</a>'</p></li>
  </ol>
  
  <p>Code - </p>
  
  <pre><code>import akka.actor._
  import akka.http.scaladsl.Http
  import akka.http.scaladsl.model._
  import akka.http.scaladsl.unmarshalling.Unmarshal
  import akka.stream.ActorMaterializer
  import akka.util.Timeout
  import scala.concurrent.{Await, Future}
  import scala.concurrent.duration._
  
  object Client {
  
    implicit val timeout: Timeout = Timeout(10.seconds)
  
    def main(args: Array[String]): Unit = {
  
      implicit val system = ActorSystem()
      implicit val materializer = ActorMaterializer()
      implicit val executionContext = system.dispatcher
  
      val responseFuture: Future[HttpResponse] =
        Http().singleRequest(
          HttpRequest(
            uri = "http://localhost:9090/xstreams/v1/offset/getOffset?appId=local-1543580292487&amp;sourceName=mysql",
            //uri="https://api.xforce.ibmcloud.com/hub/invalidcall",
            method = HttpMethods.GET
          )
        )
  
      val entity = Await.result(responseFuture, timeout.duration).entity
      val responseStringF = Unmarshal(entity).to[String]
      val responseString = Await.result(responseStringF, timeout.duration)
  
      println("\nResult = " + responseString)
  
      system.terminate()
    }
  }
  </code></pre>