Reputation: 1418
I have a RestKit request as below. How can I get the auth token from the response headers?
RKObjectManager.shared()
.getObjectsAtPath(urlString,
parameters: paramsDictionary,
success: {(operation: RKObjectRequestOperation?, result: RKMappingResult?) -> Void in
pod 'RestKit', '~> 0.27.0'
Upvotes: 0
Views: 187
Reputation: 72410
You can get response header from RKObjectRequestOperation
like this way.
if let operation = operation, let headers = operation.httpRequestOperation.response.allHeaderFields as? [String:Any] {
print(headers)// Now use subscript with headers dictionary to get your token value
}
Upvotes: 2