This file contains 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
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSHTTPURLResponse *)response { | |
if (request != nil) { | |
NSLog(@"request was %@", request); | |
} | |
if (response != nil) { | |
NSLog(@"response was %@", response); | |
} | |
return request; |
This file contains 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
+ (void)clearCaches { | |
// clear any URL caches | |
[[NSURLCache sharedURLCache] removeAllCachedResponses]; | |
// clear any cookie caches | |
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; | |
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://%@/", kAPIHost]]; | |
for (NSHTTPCookie *cookie in [cookieStorage cookiesForURL:url]) { | |
[cookieStorage deleteCookie:cookie]; | |
} |
NewerOlder