• 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: Parsing HTTP headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing HTTP headers


  • Subject: Re: Parsing HTTP headers
  • From: "Stefan Arentz" <email@hidden>
  • Date: Fri, 21 Sep 2007 21:43:35 +0200

On 9/20/07, Eyal Redler <email@hidden> wrote:
> Is there a way to compose and decompose these headers separately
> (beside writing a parser, of-course)? The only thing I could think of
> is creating an empty CFHTTPMessage and then push the header bytes
> into it but I don't know enough about HTTP to know if this will be
> considered a valid header.

This is not really rocket science. Simply use
NSString#componentsSeparatedByString to split the chunk into lines.
Then loop over over each line to find the first : with
NSString#rangeOfCharacterFromSet and then split the line into a
key/value pair, stripped from whitespace.

 S.
_______________________________________________

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

References: 
 >Parsing HTTP headers (From: Eyal Redler <email@hidden>)

  • Prev by Date: Re: really weird move file problem
  • Next by Date: Re: NSArray - move Items at indexes
  • Previous by thread: Parsing HTTP headers
  • Next by thread: NSArray - move Items at indexes
  • Index(es):
    • Date
    • Thread