We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类似Chrome 查看每次请求的size,或者像Charles抓取每个请求和响应的大小
The text was updated successfully, but these errors were encountered:
如果需要每一个请求响应的大小,可以使用NSURLProtocol来拦截进行处理即可,本项目暂时没有做这个。
NSURLProtocol
Sorry, something went wrong.
想请教一个问题,NSURLSession 获取到 response data 大小应该是解压(如何服务端开启了gzip)之后的数据,这样统计的流量是不是不准确了? 想知道这个解压缩操作发生在哪个层,CFNetwork 还是? 谢谢
Gzip传输在URL Loading System会自动处理,Accept-Encoding: gzip头会自动被加上,如果服务器支持gzip传输,那么传输内容将使用gzip进行传输,NSURLResponse响应头中的Content-Length是gzip压缩后的大小,但是当我们拿到Data时,已经是解压后的数据了,我认为是在CFNetwork层被解压了。
Gzip
URL Loading System
Accept-Encoding: gzip
gzip
NSURLResponse
Content-Length
Data
No branches or pull requests
类似Chrome 查看每次请求的size,或者像Charles抓取每个请求和响应的大小
The text was updated successfully, but these errors were encountered: