Reputation: 43
NSURLSession Request HTTP/2.0
working in iOS9.
but invalid in iOS10
my code :
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];
Upvotes: 2
Views: 1149
Reputation: 138
It looks like Charles Proxy 4 will cause iOS 10 to not use HTTP/2. It seems to work fine with iOS 9.
You can demonstrate this by loading the Akamai HTTP/2 demo in Mobile Safari in iOS 10:
If you enable Charles Proxy while visiting the site it will report to you that your browser does not support HTTP/2.
Upvotes: 9