如何获取图片流 gzip

 NSURLSessionConfiguration *aURLSessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];

aURLSessionConfiguration.HTTPAdditionalHeaders = @{@"Accept-Encoding": @"gzip, deflate",

@"Accept": @"application/pdf"};

AFHTTPSessionManager *urlManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:aURLSessionConfiguration];

urlManager.responseSerializer = [FFDataResponseSerializer serializer];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://s3.amazonaws.com/awdtest/fullzip.pdf"]];

NSURLSessionDataTask *dataTask = [urlManager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {

if (error)

{

NSLog(@"error: %@", error);

}

else

{

NSLog(@"response: %@, responseObject: %@", response, responseObject);

// responseObject is your NSData Object with the PDF data inside of it.

}

}];

[dataTask resume];

你可能感兴趣的:(如何获取图片流 gzip)