Created
August 4, 2015 14:14
-
-
Save mohammad19991/6f3e87d9afd97fe5630b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSMutableURLRequest *)imageRequestWithURL:(NSURL *)url { | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; | |
request.cachePolicy = NSURLRequestReturnCacheDataElseLoad; // this will make sure the request always returns the cached image | |
request.HTTPShouldHandleCookies = NO; | |
request.HTTPShouldUsePipelining = YES; | |
[request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; | |
return request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment