【发布时间】:2014-06-21 01:32:56
【问题描述】:
有没有办法确定您的 nsurlconnection 现在是否实际上是 gzip 而不是典型的,因为我想比较时间差异。谢谢,
【问题讨论】:
标签: ios http gzip nsurlconnection
有没有办法确定您的 nsurlconnection 现在是否实际上是 gzip 而不是典型的,因为我想比较时间差异。谢谢,
【问题讨论】:
标签: ios http gzip nsurlconnection
在NSURLConnectionDataDelegate 方法-connection:didReveiveResponse: 中,您可以检查Content-Encoding 的标头字段,例如:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
NSLog(@"%@", (NSHTTPURLResponse *)response allHeaderFields]);
}
【讨论】: