title: Calling REST service via HttpClient from ASP.net 4 Web API 2 project results in exception
body: <p><strong>Current Situation:</strong> I have created an ASP.net project (web project) using the WebAPI 2 template. One of the HTTPGET method now tries to make a request to another REST API using the following code.</p>
  
  <pre><code>[HttpGet]
  public string Get()
  {
      var uri = @"http://api.../...";
  
      var httpClient = new HttpClient();
      var response = httpClient.GetAsync(uri).GetAwaiter().GetResult(); // &lt;- exception here
  
      response.EnsureSuccessStatusCode();
  
      string content = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
  
      return content;
  }
  </code></pre>
  
  <p>At the line, marked with the comment, the following <code>HttpRequestException</code> with the message "Unable to connect to the remote server" (inner exception) is thrown.</p>
  
  <pre><code>System.Net.Http.HttpRequestException was unhandled by user code
    HResult=-2146233088
    Message=An error occurred while sending the request.
    Source=mscorlib
    ...
    InnerException: 
         HResult=-2146233079
         Message=Unable to connect to the remote server
         Source=System
         StackTrace:
              at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
              at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
         InnerException: 
              ErrorCode=10060
              HResult=-2147467259
              Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ...
              NativeErrorCode=10060
              Source=System
              StackTrace:
                   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
                   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception)
              InnerException: 
  </code></pre>
  
  <p><strong>What I tried so far:</strong></p>
  
  <ol>
  <li>I used the exact same URI (via copy &amp; paste) in the browser and the JSON with some data is returned.</li>
  <li>Before creating the WebAPI2 project I played around with the RC candidate of ASP.net 5. I created a project based on the ASP.net 5 template "Web API". There I have the exact same code and it is working fine.</li>
  </ol>
  
  <p><strong>Assumption:</strong> My assumption is that the config in the ASP.net 4 Web API 2 template has some config that prevents from getting a response. I found some similar <a href="https://stackoverflow.com/questions/12634142/error-in-calling-rest-services-unable-to-connect-to-the-remote-server">question</a> on SO where it seems that some private networking was disabled. </p>
  
  <p><strong>Question:</strong> What does prevent the response from being received when using HttpClient in a ASP.net 4 Web API 2 based project?</p>