I'm using the new version of AFNetworking and I can't figure out how to read the headers of the response. I'm using the AFHTTPSessionManager to perform my query, everything works well but I'm unable to find the header response field.
Here is how I proceed
self.sessionManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:BASE_URL]];
[self.sessionManager GET:urlId parameters:nil
success:^(NSURLSessionDataTask *task, id responseObject) {
if ([self.delegate respondsToSelector:@selector(userIsLoadedWithInfos:)]) {
[self.delegate userIsLoadedWithInfos: responseObject];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
if ([self.delegate respondsToSelector:@selector(userLoadingFailed)]) {
[self.delegate userLoadingFailed];
}
}
];
I tried to read the response attribute of task but it return an NSURLResponse which doesn't include the headers.
Does anyone now how to read the response headers with the 2.0 version?