I am trying to get html response from server (aspx).
NSString *urlstr = [[NSString alloc] initWithFormat:@"http://www.someSiteThatRedirectsWithGetParameters.com?parameter1=1¶meter2=2"]; NSURL *url = [ NSURL URLWithString:urlstr]; NSMutableURLRequest *urlRequest = [ NSURLRequest requestWithURL: url]; NSData data = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error]; NSURL *lastURL=[response URL]; NSLog(@"Last url %@", lastURL);
I get lastURL as www.someSiteThatRedirectsWithGetParameters.com and therefore do not get the html page for the original URL.
Why is this and how can I solve it?
EDIT
That's all I have tried so far: Get the last redirected URL in iOS 5? but I still canβt achieve what I am trying to do as follows: get the source of the html page of the original GET request (passing the redirect) with the parameters in the url?
lastURL www.someSiteThatRedirectsWithGetParameters.com html- , URL-.
, , , , , URL-, , , URL. .
HTTP 303, POST GET. , , . - URL-, , , URL-, .
?
"" . "" - URL-, .
. , redirectURL . URL- , URL- GET. , , , .