When I execute an HTTP request with an authorization token as a header, using Alamofire, the request is executed twice:
1) the first execution without the authorization, gets a 401 status code
2) the second with the authorization included, gets the expected 200
Is that normal or is that a bug? If that is normal, could that be disabled? Is that recommended?
myNewRequest.headers["Authorization"] = token
SessionManager.default.request(newRequest)
.validate()
.response(queue: DispatchQueue.main) { _ in
// handle request
}