I am using ASIHTTPRequest in my app to handle Google login in my app.
in one of my requests i get Redirect and this is what i do:
- (void)request:(ASIHTTPRequest *)request willRedirectToURL:(NSURL *)newURL{
ASIHTTPRequest *redirect = [[ASIHTTPRequest alloc] initWithURL:newURL];
[redirect setTimeOutSeconds:30];
[redirect setValidatesSecureCertificate:NO];
[redirect setDelegate:self];
[redirect startAsynchronous];
NSLog(@"Redirect - %@",url);
}
And when i make this request non of the ASIHTTPRequest delegate methods not called, the is the url that i make the redirect:
https://accounts.google.com/Logout2?service=sj&ilo=1&ils=s.IL&ilc=0&continue=http%3A%2F%2Fmusic.google.com%2Fmusic%2Flisten&zx=-834167044
Any idea why it happen?
Edit
The newURL is equal to :
https://accounts.google.com/Logout2?service=sj&ilo=1&ils=s.IL&ilc=0&continue=http%3A%2F%2Fmusic.google.com%2Fmusic%2Flisten&zx=835989037
but when i try to get the html i get the the redirect url is :
https://accounts.google.com/Logout2?service=sj&ilo=1&ils=s.IL&ilc=0&continue=http%3A%2F%2Fmusic.google.com%2Fmusic%2Flisten&zx=835989037
And there is diffrent between the two.any idea why?
Why are you redirecting with a new
ASIHTTPRequestwhen the original request will open the same URL? What happens when you don’t redirect with the new request?I think that you’d better stop the original request and then create the new one.