Skip navigation.
 
mlRe: HTTP Headers
FROM : Uli Kusterer
DATE : Sat May 03 23:52:15 2008

Am 03.05.2008 um 23:35 schrieb Jeremy:
> Is there an easy way within Obj-C to read HTTP headers, to write 
> HTTP headers, and to send HTTP headers? As this will be the easiest 
> way for me to authenticate for an XML API I am using, and to read 
> http status codes (if the action was completed - or the error).



NSURLRequest and NSURLHandle (or was it NSURLConnection?) let you do 
that. Anyway, a search for NSURL at http://developer.apple.com should 
provide the right name for the APIs involved. You essentially pass in 
a dictionary with the header name as the key and the header content as 
the value. Of course that means that you can't easily have several 
headers with the same name (like it'd be done for an SMTP server), but 
for most uses it works.

There might even be sample code for doing HTTP GET or POST requests at http://cocoadev.com

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de

Related mailsAuthorDate
mlHTTP Headers Jeremy May 3, 23:35
mlRe: HTTP Headers Uli Kusterer May 3, 23:52
mlRe: HTTP Headers Jeremy May 4, 00:05
mlRe: HTTP Headers Kyle Sluder May 4, 00:16