title: ASP.NET MVC 4 to ASP.NET Web API - Error: Only 'http' and 'https' schemes are allowed. Parameter name: requestUri
body: <p>ASP.NET MVC throws the following error in TEST Server, which I could not reproduce in Developer machines.</p>
  
  <p>Trying to connect to WebAPI Service from MVC and getting the error</p>
  
  <p><strong>Only 'http' and 'https' schemes are allowed.  Parameter name: requestUri</strong></p>
  
  <p>I could not get an answer from other questions since they are mainly talking about WCF bindings.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>var credentials = "username:Password";
  var encoded = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(credentials));
  this.client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", encoded);
  System.Net.Http.HttpClient client = new HttpClient();
  HttpResponseMessage response = client.GetAsync(URL).Result; 
  </code></pre>
  
  <p><strong>Note:</strong> Accessing the WebAPI URL through browser returns the data.</p>