Getting "Location" header from NSHTTPURLResponse

Posted by aspcartman on Stack Overflow See other posts from Stack Overflow or by aspcartman
Published on 2010-03-25T08:21:12Z Indexed on 2010/03/25 8:23 UTC
Read the original article Hit count: 321

Filed under:
|

Can't get "Location" header from response at all. Wireshark says that i've got one:

Location: http://*/index.html#0;sid=865a84f0212a3a35d8e9d5f68398e535

But

NSHTTPURLResponse *hr = (NSHTTPURLResponse*)response;
NSDictionary *dict = [hr allHeaderFields];          
NSLog(@"HEADERS : %@",[dict description]);

Produces this:

HEADERS : {
    Connection = "keep-alive";
    "Content-Encoding" = gzip;
    "Content-Type" = "text/html";
    Date = "Thu, 25 Mar 2010 08:12:08 GMT";
    "Last-Modified" = "Sat, 29 Nov 2008 15:50:54 GMT";
    Server = "nginx/0.7.59";
    "Transfer-Encoding" = Identity;
}

No location anywhere. How to get it? I need this "sid" thing.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk-3.0