Re: Parsing HTTP headers
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