curl-library
Re: Adding empty HTTP Headers to curl requests?
Date: Thu, 26 Jan 2006 12:32:26 +0100 (CET)
On Thu, 26 Jan 2006, Cyrill Osterwalder wrote:
> I'm wondering if libcurl supports adding empty HTTP headers to requests? An
> empty HTTP header means a header that does not have a value after the colon,
> e.g. ("EmptyHeader:").
No it doesn't! ;-(
> Empty HTTP headers are imho legal according to RFC. They are used in certain
> environments to indicate special things to back-end services.
Yes, I agree that it was a bad choice back then to prevent blank headers...
but hey, what's done is done!
> Any suggestions how empty HTTP headers could/should be supported by libcurl?
Not really, but I'm thinking we could for example exploit the fact that
headers aren't allowed to contain ascii 1 - 31, not in the name nor in the
"field-body" part. Thus we could easily for example let "header:\x01" mean
"add this header with a blank data". We could even hide the kludgy feeling by
using a define instead of \x01, like: "header:" NO_FIELD_BODY or similar.
Opinions? Other ideas?
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2006-01-26