转自:http://lj-1105.blog.163.com/blog/static/109953129201081322237795/
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{NSHTTPURLResponse * httpResponse;
NSString * contentTypeHeader;
httpResponse = (NSHTTPURLResponse *) response;
assert( [httpResponse isKindOfClass:[NSHTTPURLResponse class]] );
NSDictionary *httpResponseHeaderFields = [httpResponse allHeaderFields];
NSLog(@" %@",httpResponseHeaderFields );
nStatusCode = httpResponse.statusCode;
if (nStatusCode != 200)
{
}
else
{
contentTypeHeader = [httpResponse.allHeaderFields objectForKey:@"Content-Type"];
}
}