tags:

views:

215

answers:

2

Hi all im having a bunch of crappy looking code here (dont get me on that). This code is posting a new entry on pastebin.com. Once you posted something on pastebin it will forward you to a new url address in php it uses header('Location:....');.

What i want to know is how to get the forwarded url from this NSMutableURLRequest..

PS: Debug output ==

2009-08-20 17:51:13.025 PasteBin[28620:a0f] Error: (null) 2009-08-20 17:51:13.026 PasteBin[28620:a0f] Response: { Connection = "Keep-Alive"; "Content-Type" = "text/html; charset=iso-8859-1"; Date = "Thu, 20 Aug 2009 15:51:12 GMT"; "Keep-Alive" = "timeout=15, max=100"; Server = "Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 PHP/4.3.10-22 mod_perl/1.29"; "Transfer-Encoding" = Identity; "X-Powered-By" = "PHP/4.3.10-22"; }

I hope some one can help me out please.

A: 

I found the answer

its:

[response URL];

Johnny Mast
+2  A: 

You don't get anything from the request; the request is what you send to the server. You would get the information you're looking for from the response.

Don't forget to look in NSHTTPURLResponse and not just its more-general superclass.

Peter Hosey
[response URL] worked out great for me..
Johnny Mast