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];
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:
https://http2.akamai.com/demo
If you enable Charles Proxy while visiting the site it will report to you that your browser does not support HTTP/2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With