How do you retrieve all HTTP headers from a NSURLRequest in Objective-C?
You can use AFHTTPSessionManager framework and get The headers after a request or during, example below (to get all keys):
NSHTTPURLResponse *reponse = (NSHTTPURLResponse *)task.response; NSLog(@"%@", [reponseHeaders allHeaderFields]);
To access a specific key: [reponseHeaders allHeaderFields][@"someKey"]
Refer to: https://github.com/AFNetworking/AFNetworking/issues/3688