title: HttpClient on ASP.NET Core application times out when connecting to service on localhost
body: <p>I have a XML-RPC server (using XML-RPC.net) running as a .NET console application. I'm trying to connect to it via my ASP.NET Core (2.1.1) web app but the client keeps timing out. Postman also returns a response immediately without issues.</p>
  
  <p>Here is how I'm calling it:</p>
  
  <pre><code>        HttpClient client = _clientFactory.CreateClient();
  
          client.Timeout = TimeSpan.FromSeconds(10);
  
          var httpRequest = new HttpRequestMessage(HttpMethod.Post, instance.ServiceUrl);
          var stringContent = new ByteArrayContent(Encoding.UTF8.GetBytes(request.ToString()));
  
          httpRequest.Content = stringContent;
          httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("text/xml");
  
          var httpResponse = await client.SendAsync(httpRequest);
          var response = await httpResponse.Content.ReadAsByteArrayAsync();
  </code></pre>
  
  <p>I can see that the request was made successfully as the console app returns a response. Fiddler shows there was a 200 response but <code>await client.SendAsync(httpRequest);</code> times-out! </p>
  
  <p>The request usually completes in under 10ms so the timeout value is just for debugging, if I leave it out it would take 60s. The response returns XML.</p>
  
  <p>I've tried rewriting this to use <code>StringContent</code> and using <code>PostAsync</code>, same issue. I also attempted to rewrite this using <code>WebClient</code> but it returned <code>The remote server returned an error: (100) Continue.</code> not sure if that's relevant.</p>
  
  <p>Been stuck on this for a whie, anyone know what could be happening?</p>