My app creates POST request with Authorization header - it looks like :
let accessToken = "veryCoolToken"
var request = URLRequest(url: myURL)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "content-type")
request.addValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("token=\"\(accessToken)\"", forHTTPHeaderField: "Authorization")
I already checked this request with Postman app - it was fine. But for some reason I received needed result only from Postman and not from my app.
So after taking apart request on my Server - I found that when my app sending POST request - it is not "Authorization" but "authorization".
Why is that happening?
What else should I take in consideration when app sends POST request with headers?