views:

278

answers:

2

The title to this question says it all. NSURLRequest + NSHTTPURLResponse is clearly the way to role. How do I just grab the header info?

Cheers, Doug

A: 

⌘-doubleclick on a reference to "NSHTTPURLResponse" in your code, and it will show you the documentation.

Nathan de Vries
+1  A: 

Calling allHeaderFields on your NSHTTPURLResponse will return them as a dictionary.

[response allHeaderFields]

where response is your NSHTTPURLResponse object.

paulthenerd
Additionally, using an NSMutableURLRequest and calling [request setHTTPMethod:@"HEAD"] will result in less bandwidth being used (if the server supports it)
rpetrich
rpetrich,This is the critical bit I was looking for. I DON'T want to grab the entire message body of the URL which is many gigabytes. Thanks so much for the pointer.Cheers,Doug
dugla