I need to modify response headers in an NSURLResponse. Is this possible?
You can read them into a NSDictionary using the allHeaderFields
method.
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
NSDictionary *httpResponseHeaderFields = [httpResponse
allHeaderFields];
To be 100% safe you'd want to wrap it with
if ([response respondsToSelector:@selector(allHeaderFields)]) {... }