Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <Foundation/Foundation.h>
- NSDictionary *headers = @{ @"cache-control": @"no-cache",
- @"postman-token": @"f531b7db-3575-8b1e-653b-d1fb3786aeed" };
- NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://54.207.80.28/api-lebox/cita/prueba_rest?estudio=1.3.6.1.4.1.18397.10.10.700206911201504131124113"]
- cachePolicy:NSURLRequestUseProtocolCachePolicy
- timeoutInterval:10.0];
- [request setHTTPMethod:@"POST"];
- [request setAllHTTPHeaderFields:headers];
- 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];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement