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)go { | |
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; | |
[request setURL:[NSURL URLWithString:@"http://httpbin.org/headers"]]; | |
[request setHTTPShouldHandleCookies:NO]; | |
[request setHTTPMethod:@"GET"]; | |
[request setValue:@"Test" forHTTPHeaderField:@"User-Agent"]; | |
[request setTimeoutInterval:10]; | |
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; | |
if (connection) { |
NewerOlder