【问题标题】:ASIHTTPRequest with iPhone 3GASIHTTPRequest 与 iPhone 3G
【发布时间】:2012-04-10 10:09:32
【问题描述】:

我在我的项目中使用 ASIHTTPRequest,但我遇到了 iPhone 3G 的问题。 我发送请求到:

NSURL* pageURL = [NSURL URLWithString:@"https://accounts.google.com/ServiceLogin?service=sj"];
loginPageRequest = [[ASIHTTPRequest alloc] initWithURL:pageURL];
[loginPageRequest setTimeOutSeconds:30];
[loginPageRequest setDelegate:self];
[loginPageRequest startAsynchronous];

在其他设备上我得到了回应:

- (void)requestFinished:(ASIHTTPRequest *)request

在 iPhone 3G 中我得到了很多次:

- (void)requestFailed:(ASIHTTPRequest *)request

错误信息:The request timed out

我将请求超时设置为 30 秒。

知道为什么会这样吗?

【问题讨论】:

  • 可能是你的ASIHTTPRequest在3G下需要更多的时间,把30改成90试试吧

标签: iphone objective-c asihttprequest


【解决方案1】:

我在 iPhone 3G 上也遇到过这个问题! 我发现这是一个 HTTP*S* (SSL) 问题。我的“有效”证书被标记为无效。

您可以在请求中添加[request setValidatesSecureCertificate:NO];

如果你很幸运,你也会遇到同样的问题。 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-25
    相关资源
    最近更新 更多