• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HTTP Headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTP Headers


  • Subject: Re: HTTP Headers
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 3 May 2008 23:52:15 +0200


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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: HTTP Headers
      • From: Jeremy <email@hidden>
References: 
 >HTTP Headers (From: Jeremy <email@hidden>)

  • Prev by Date: Proxy Window of another
  • Next by Date: Re: HTTP Headers
  • Previous by thread: HTTP Headers
  • Next by thread: Re: HTTP Headers
  • Index(es):
    • Date
    • Thread