title: Xamarin forms not sending Authorization header
body: <p>I know this question might seem like a duplicate, but I have tried every solution I saw before asking this question again.</p>
  
  <p>I'm trying to consume a REST API which I wrote myself with Django Rest Framework, using C# HttpClient in Xamarin Forms. The request is being sent but it does not include the required <strong>Authorization</strong> with <strong>Token</strong> as scheme.</p>
  
  <p>Here are the things I've tried:</p>
  
  <pre><code>public async Task&lt;IssueListModelView&gt; FetchIssues(string token, string type)
  {
      client.BaseAddress = new Uri(XTMonitorContants.SERVICE_BASE_URL);
      HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, new Uri(XTMonitorContants.SERVICE_ISSUES_URL + type.ToLower()));
  
      request.Headers.Add("Authorization", "Token " + token);
  
      //client.
      //client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", token); 
      client.DefaultRequestHeaders.Add("Authorization", "Token " + token);
      var response = client.SendAsync(request);
      var jsonString = response.ContinueWith(t =&gt; { return t.Result; }).Result.Content.ReadAsStringAsync().Result;
  
      IssueListModelView resp = new IssueListModelView();
      if (jsonString != "")
      {
          try
          {
              resp = JsonConvert.DeserializeObject&lt;IssueListModelView&gt;(jsonString);
          }
          catch (Exception)
          {
              resp.error = "Internal Server Error";
          }
  
      }
      return resp;
  }
  </code></pre>
  
  <p>I have also tried to send the request directly without using <strong>HttpRequestMessage</strong>, but also gave me the same server response of </p>
  
  <blockquote>
    <p>"Authentication credentials were not provided."</p>
  </blockquote>
  
  <p><strong>Request made by Postman</strong></p>
  
  <blockquote>
    <p>GET /api/issues/all HTTP/1.1 </p>
    
    <p>Host: example.com </p>
    
    <p>Authorization: Token ffba1c43ac346945b788768e2a428d5e5d3c1fc9 </p>
    
    <p>Cache-Control: no-cache</p>
    
    <p>Postman-Token: 0c1eb96d-d9d6-a9e7-0cfa-0444fdc0248e</p>
  </blockquote>
  
  <p><strong>Request made by HttpClient</strong></p>
  
  <pre><code>{Method: GET, RequestUri: 'https://example.com/api/issues/all', Version: 1.1, Content: &lt;null&gt;, Headers: { Authorization: Token ffba1c43ac346945b788768e2a428d5e5d3c1fc9 }}
  </code></pre>
  
  <p>Please note that I've tested the API properly using Postman and also setup Swagger, it works fine on both.</p>
  
  <p>Would be glad if someone could give me a hand here, as I think there's probably something I'm missing out</p>