title: HttpClient Returns 404 not found
body: <p>I have a xamarin app that pull data from a webAPI. I check api address so many times and i am sure it is correct. When i debug my code i have 404 not found error from server. However when i copy and paste the URL to browser i have expected result. I couldn't figure out why my app return 404.</p>
  
  <p>My Method:</p>
  
  <pre><code>   public async Task&lt;ICustomerType&gt; GetById(int id)
      {
          string _token;
  
          if (App.Current.Properties.ContainsKey("token"))
          {
              _token = (string)App.Current.Properties["token"];
          }
          else
          { _token = null; }
  
          var webApiResponse =
              _connector.PostAsync(
                  "api/Customer/get/id/" + id,
                  string.Empty, _token).Result;
  
          var response = webApiResponse.Result.ToString();
  
          var jObjectResponse = JObject.Parse(response);
  
          ICustomerType customerTypeObj = null;
  
          return customerTypeObj;
      }
  </code></pre>
  
  <p>My bridge method to HttpClient's PostAsync method:</p>
  
  <pre><code>    private async Task&lt;TResponse&gt; PostAsync(string requestPath, string 
  jsonContent, bool getToken, string token)
      {
          HttpClient client = new HttpClient();
  
              client.BaseAddress = new Uri(_apiUrl);
              client.DefaultRequestHeaders.Accept.Clear();
              var contentType = new MediaTypeWithQualityHeaderValue("application/json");
              client.DefaultRequestHeaders.Accept.Add(contentType);
  
              if (getToken)
              {
                  token =  GetApiTokenAsync().Result;
              }
  
              if (!string.IsNullOrEmpty(token))
              {
                  client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
              }
  
              var httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json");
  
              var response = client.PostAsync(requestPath, httpContent).Result;
              var jsonData = await response.Content.ReadAsStringAsync();
              return JsonConvert.DeserializeObject&lt;TResponse&gt;(jsonData);
  
      }
  </code></pre>
  
  <p>Token: Correct</p>
  
  <p>API Url: Correct(I check "/" signs from debug output.They are well placed. My Api like: 
   <a href="https://MyApi.net/api/Personel/get/id/1" rel="nofollow noreferrer">https://MyApi.net/api/Personel/get/id/1</a>)</p>
  
  <p>My Error:</p>
  
  <blockquote>
    <ul>
    <li>response    {StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: {   Request-Context:
    appId=cid-v1:Some_String   Server: Kestrel<br>
    Strict-Transport-Security: max-age=Some_Int   Set-Cookie:
    ARRAffinity=Some_String;Path=/;HttpOnly;Domain=MyDomain   Date: Mon,
    09 Jul 2018 07:54:19 GMT   X-Powered-By: ASP.NET   Content-Length: 0
    }}    System.Net.Http.HttpResponseMessage</li>
    </ul>
  </blockquote>