NSURLSession請求HTTP/2.0iOS10 NSURLSession HTTP/2無效
可在iOS9中使用。
但無效在iOS10
我的代碼:
NSURLSession *session = [NSURLSession sharedSession];
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://ga.seeyouyima.com/page"]];
[request setHTTPMethod:@"POST"];
[[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (completedBlock) {
completedBlock(data, response, error);
}
}] resume];
您的代碼是必需的。 –
可能是證書配置有問題。我有類似的[問題](http://stackoverflow.com/q/39544547/3871718)。 – new2ios
服務器證書使用TLSv1.2。 –