title: Swift: Request authorization header is not set
body: <p>I have a request endpoint for sylius <a href="https://demo.sylius.com/api/v2/products" rel="nofollow noreferrer">API</a> when I set the content-type header with <code>application/json</code> and the <code>Authorization</code> header with the <strong>exact value</strong> <code>Bearer SampleToken</code> through postman it responds fine with the intended response but when I try to set the request authorization header through <code>URLRequest</code> it gives me a response </p>
  
  <pre><code>{
      error = "access_denied";
      "error_description" = "OAuth2 authentication required";
  }
  </code></pre>
  
  <p>when I monitor the request through charles I've noticed that the <code>Authorization</code> header is stripped off. I've tried many various ways to set the authorization header but with no luck.</p>
  
  <pre><code>func getTotalProducts(page:String){
      let urlPath="https://demo.sylius.com/api/v2/products"
      var request = URLRequest(url:  NSURL(string: urlPath)! as URL)
      request.httpMethod = "GET"
  
      request.setValue("Bearer SampleToken", forHTTPHeaderField: "Authorization")
      request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  
      Alamofire.request(request)
          .responseJSON { response in
              switch(response.result){
              case .success(let value):
                  print(value)
                  break
              case .failure(let error):
                  print("something went wrong \(error.localizedDescription)")
              }
          }.session.finishTasksAndInvalidate()
  }
  </code></pre>
  
  <p>The original postman request:</p>
  
  <p><a href="https://i.stack.imgur.com/hMK4Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hMK4Y.png" alt="enter image description here"></a></p>