0

I am trying to get response from one URL in my iOS app which is giving me timeout but when i open that URL on safari, it seems work fine.

I tried installing the certificate as well from the URL but it still not working.

Can any one let me know what could be the issue?

NSMutableURLRequest *urlReq = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:180.0];

NSString * httpMeth = HttpMethod;
[urlRequest setHTTPMethod:httpMeth];

__block void (^completionHandler)(NSData*, NSURLResponse*, NSError*) =
^void(NSData *data ,NSURLResponse *response ,NSError *connectionError)
{

    dispatch_async(dispatch_get_main_queue(), ^{
        [self connectionRecivedResponse:response withData:data
                        connectionError:connectionError];
    });

};

NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:config];

[[session dataTaskWithRequest:urlReq completionHandler:config]

Mini2008
  • 627
  • 1
  • 6
  • 12

0 Answers0