Re: CFHTTPMessage and HTTP headers
Re: CFHTTPMessage and HTTP headers
- Subject: Re: CFHTTPMessage and HTTP headers
- From: Frederick Cheung <email@hidden>
- Date: Thu, 21 Apr 2005 20:26:21 +0100
Message: 1
Date: Thu, 21 Apr 2005 18:07:25 +0400
From: Alexey Proskuryakov <email@hidden>
Subject: CFHTTPMessage and HTTP headers
To: <email@hidden>
Message-ID: <BE8D9C5D.16CE2%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
Is there a reason why CFHTTP changes the case of additional HTTP
headers
provided by CFHTTPMessageSetHeaderFieldValue()? For example, code like
CFHTTPMessageSetHeaderFieldValue(msg, CFSTR("SOAPAction"), CFSTR(""));
results in a request like this:
POST / HTTP/1.1
User-Agent: CFNetwork/1.1
Soapaction:
<...>
I know that HTTP headers are supposed to be case-insensitive, yet
it's
somewhat strange to see SOAPAction changed like this...
It always "normalizes" the case, ie the first letter of a word is in
caps, all the rest in lowercase. I reckon the main reason for this is
because you have a dictionary of header values (at least this is what
is exposed to the user), and it's is much simpler if you know that the
header names are all going to be capitalised in a certain way. You
would want to have to go searching through the dictionary for a key
that was the same modulo case to the header you were looking for. I
suppose they could have used some fancy key callbacks for their
dictionary but that probably ends up being more complicated.
Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden