gpt4 book ai didi

objective-c - AF联网进展

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:51:12 25 4
gpt4 key购买 nike

我正在尝试使用 AFHTTPRequestOperation 类的 setDownloadProgressBlock。回调给了我 3 个参数:

( NSInteger bytesRead , NSInteger totalBytesRead , NSInteger totalBytesExpectedToRead ) 

为了获得进度,我需要 totalBytesExpectedToRead 值,但它给了我一个 -1。我检查了 HTTP 响应的 header ,内容长度在那里...

{
"Cache-Control" = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
Connection = "Keep-Alive";
"Content-Encoding" = gzip;
"Content-Length" = 36902;
"Content-Type" = "text/plain";
Date = "Sat, 03 Mar 2012 23:53:11 GMT";
Expires = "Thu, 19 Nov 1981 08:52:00 GMT";
"Keep-Alive" = "timeout=5, max=95";
"Last-Modified" = "Sat, 03 Mar 2012 23:53:11 GMT";
Pragma = "no-cache";
Server = "Apache/2.2.20 (Ubuntu)";
Vary = "Accept-Encoding";
"X-Powered-By" = "PHP/5.3.6-13ubuntu3.3";
}

这是 AFNetworking 框架的问题吗?

最佳答案

请检查以下响应,这是与 gzip 格式的内容相关的 NSURLConnection 限制:https://stackoverflow.com/a/7426735/250164

关于objective-c - AF联网进展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9550971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com