[ingela@REDACTED: Re: http:request/4 headers]

Michael McDaniel erlang@REDACTED
Fri Apr 15 16:33:33 CEST 2005


----- Forwarded message from Ingela Anderton <ingela@REDACTED> -----

From: Ingela Anderton <ingela@REDACTED>
Date: Fri, 15 Apr 2005 08:54:17 +0200
To: erlang@REDACTED
Subject: Re: http:request/4 headers


Michael McDaniel wrote:
> I need to control case for http headers POSTing to an application.
> 
> http:request/4 makes my headers lowercase.
> 
> QUESTION: How can I keep my headers the case I want.
> 
> 
> EXAMPLE:
>   catch http:request(post,
>   {"http://server.providing.services.example.com/specialApplication/",
>   [ 
>      {"Date", httpd_util:rfc1123_date()} ,
>      {"Host", "server.providing.services.example.com"} ,
>      {"REALM",  "SPECMA"} ,
>      {"APIVER", "SPECMA:2.0"} ,
>      {"Authorization ", http_base_64:encode("username:password")} ,
>      {"Accept", "text/xml/html"},
>      {"User-Agent",  "erlang client"} 
>   ], "application/x-www-form-urlencoded", Body }, [], []).
> 
> All the headers are converted to lower case and the application needs the
> uppercase headers as uppercase.  Works the same with http or https.
> 
> I have not yet found the control to keep uppercase headers; thanks for any assistance.

At the moment there is no such option in inets. If there is a good
enough reason I could perhaps add one, but for the moment it does not
feel very prioritized! As I see it the real problem is that your
application is not abiding to the standard.

>From the RFC 2616: HTTP header fields, which include
general-header (section 4.5), request-header (section 5.3),
response-header (section 6.2), and entity-header (section 7.1) fields,
follow the same generic format as that given in Section 3.1 of RFC 822
[9]. Each header field consists of a name followed by a colon (":")
and the field value. Field names are case-insensitive.
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

-- 
/Ingela - OTP team







----- End forwarded message -----



More information about the erlang-questions mailing list