mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 15:18:27 -04:00
19 lines
1.1 KiB
Objective-C
Executable File
19 lines
1.1 KiB
Objective-C
Executable File
#import <Foundation/Foundation.h>
|
|
|
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://mockbin.com/har"]
|
|
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
|
timeoutInterval:10.0];
|
|
[request setHTTPMethod:@"GET"];
|
|
|
|
NSURLSession *session = [NSURLSession sharedSession];
|
|
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
|
|
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
|
|
if (error) {
|
|
NSLog(@"%@", error);
|
|
} else {
|
|
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
|
|
NSLog(@"%@", httpResponse);
|
|
}
|
|
}];
|
|
[dataTask resume];
|