NSURLRequest + NSHTTPURLResponse is clearly the way to role. How do I just grab the header info?
Asked
Active
Viewed 2,464 times
2 Answers
3
Calling allHeaderFields on your NSHTTPURLResponse will return them as a dictionary.
[response allHeaderFields]
where response is your NSHTTPURLResponse object.

paulthenerd
- 9,487
- 2
- 35
- 29
-
4Additionally, using an NSMutableURLRequest and calling [request setHTTPMethod:@"HEAD"] will result in less bandwidth being used (if the server supports it) – rpetrich Aug 30 '09 at 11:35
-
1rpetrich, 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 Aug 30 '09 at 12:23
-2
⌘-doubleclick on a reference to "NSHTTPURLResponse" in your code, and it will show you the documentation.

Nathan de Vries
- 15,481
- 4
- 49
- 55
-
That doesn't show the documentation, it just links to the header file with the method signature. – PostCodeism Apr 21 '11 at 16:53