ASIHTTPRequest with iPhone 3G

可紊 提交于 2019-12-11 06:39:00

问题


I am using ASIHTTPRequest in my project and i have a problem with iPhone 3G. i send a request to :

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

and in other devices i get a responde to :

- (void)requestFinished:(ASIHTTPRequest *)request

and in iPhone 3G i get a lot of times :

- (void)requestFailed:(ASIHTTPRequest *)request

with error MSG : The request timed out

i set the the request timeout to 30 seconds.

any idea why it happen?


回答1:


I also had this problem on iPhone 3G! I figured out it was a HTTP*S* (SSL) problem. My "valid" certificate was flagged as invalid.

You might add [request setValidatesSecureCertificate:NO]; to your request.

If you are lucky you have the same problem. :)



来源:https://stackoverflow.com/questions/10086768/asihttprequest-with-iphone-3g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!