I tried to add custom header with this:
let manager = Manager.sharedInstance
manager.session.configuration.HTTPAdditionalHeaders = [
\"Authorization\": \
You should not append Authorization
headers in this way. They should always be appended using the headers
parameter in the request
method as shown by @Glenn.
Additionally, if you need to append other headers to a configuration, you need to create a custom configuration, set the header values, then create a new Manager
instance with the new configuration. Adding headers to a configuration after it has already been used to create a URL session results in undefined behavior depending on which version of which OS you are running on. We have many tests in Alamofire demonstrating this varying behavior.