使用iPhone 3G进行ASIHTTPRequest

时间:2012-04-10 10:09:33

标签: iphone objective-c asihttprequest

我在我的项目中使用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

错误MSG:The request timed out

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

知道为什么会这样吗?

1 个答案:

答案 0 :(得分:1)

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

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

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