问题
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