+(void)cacheDataWithUrl:(NSString *)url
{
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://pic1.bbzhi.com/huahuibizhi/meilisuihuabuzhifenhongtianmeixi/flower_flower_pattern_sweet_pink_47584_3.jpg"]];
[req addValue:@"image/*" forHTTPHeaderField:@"Accept"];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:req];
operation.responseSerializer = [AFImageResponseSerializer serializer];
operation.outputStream = [NSOutputStream outputStreamToMemory];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"success");
UIImage *image = responseObject;
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
// Deal with failure
NSLog(@"failed.%@", error);
}];
[operation start];
}