• 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: Jeremy <email@hidden>
  • Date: Sat, 3 May 2008 18:05:56 -0400

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 (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: "Kyle Sluder" <email@hidden>
References: 
 >HTTP Headers (From: Jeremy <email@hidden>)
 >Re: HTTP Headers (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: HTTP Headers
  • Next by Date: Re: Newbie Question: Controls not redrawing on changes
  • Previous by thread: Re: HTTP Headers
  • Next by thread: Re: HTTP Headers
  • Index(es):
    • Date
    • Thread