李江淮*_*李江淮 2 http2 ios10 charles-proxy
NSURLSession请求HTTP/2.0
在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];
Run Code Online (Sandbox Code Playgroud)
小智 9
看起来Charles Proxy 4会导致iOS 10不使用HTTP/2.它似乎适用于iOS 9.
您可以通过在iOS 10中的Mobile Safari中加载Akamai HTTP/2演示来证明这一点:
如果您在访问站点时启用Charles Proxy,它将向您报告您的浏览器不支持HTTP/2.
| 归档时间: |
|
| 查看次数: |
893 次 |
| 最近记录: |