So... Using

[NSURLRequest HTTPBody]; will return what is returned. I don't see any way to build and send HTTP headers.

Jeremy
"For a long time it puzzled me how something so expensive, so leading edge, could be so useless, and then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match." - Bill Bryson


On May 3, 2008, at 5:52 PM, Uli Kusterer wrote:


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






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to