我正在使用asihttprequest连接并提交数据。我使用了超时选项,但它不起作用!
[request setTimeOutSeconds:20];
[request setDelegate:self];
[request startAsynchronous];
它会在默认值 10 秒后继续超时。有人遇到同样的问题吗? 我发送的数据是一个包含3个字母的字符串。
最佳答案
这对我有用。
首先,请确保您使用的是最新版本的 ASIHTTPRequest。
如果不适合,请尝试在 ASIHTTPRequest.m 选择器 shouldTimeOut 中的第一个 if 的主体内设置一个断点 - 检查 [self timeoutSeconds] 和 secondarySinceLastActivity 的值。如果你超时了,其中之一一定是错误的;如果是 timeoutSeconds 则回溯并查看为什么没有将其设置为 20 秒。
关于iphone - asihttp请求超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3987204/