title: HttpClient.GetAsync, Invalid URI exception
body: <p>The below mentioned code doesn't work. I get the following exception in <code>GetAsync</code>:</p>
  
  <blockquote>
    <p>Invalid URI: The format of the URI could not be determined.</p>
  </blockquote>
  
  <p>However, if I comment the <code>apiClient.BaseAddress</code> and specify the full URI in <code>apiClient.GetAsync</code> then it works fine!</p>
  
  <p>Could someone please explain the reason?</p>
  
  <p><strong>DEV Environment:</strong>
  VS2012, .NET 4.5, C#, ASP.NET WebForms</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>private async Task WebAPICall()
  {
      using (var apiClient = new HttpClient())
      {
          apiClient.BaseAddress = new Uri("http://localhost:9000/");
          apiClient.DefaultRequestHeaders.Accept.Clear();
          apiClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
          apiClient.Timeout = new TimeSpan(0, 0, 30);
  
          try
          {
              HttpResponseMessage apiResponseMsg = await apiClient.GetAsync(new Uri("api/products/" + txtProductID.Text.Trim()));
              string strResponse = await apiResponseMsg.Content.ReadAsStringAsync();
              Response.Write(strResponse);
          }
          catch (Exception ex)
          {
              Response.Write(ex.Message);
          }
  
      } //using (var apiClient = new HttpClient())
  } //private async Task WebAPICall()
  </code></pre>