I am trying to get data through JSON approach using nsurlsessiondatatask but I am unable to get the data out of the data task completion handler.
Please help????
I am trying to get data through JSON approach using nsurlsessiondatatask but I am unable to get the data out of the data task completion handler.
Please help????
NSURLSessionDataTask has a method called resume. Make sure you call it after you create your data task object.
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@""] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSLog(@"%@", response);
}];
[task resume];