[erlang-questions] Erlang HTTP Client always reformats header field names to lowercase
Edward Wang
edward.yujiang.wang@REDACTED
Sun Apr 24 12:17:22 CEST 2011
Anish,
Try this:
http:request(get,{"http://10.37.184.222:20080/",[{"Authorization",
"Basic dGVqYXM6adcnZSMwNXQ="}]},[],[{headers_as_is, true}]).
On Sun, Apr 24, 2011 at 3:47 PM, Anish Parameswaran <
anishparameswaran@REDACTED> wrote:
> Hi ,
>
> I am new to Erlang .
>
> I use the following code to access a web server . The web server
> doesn't service
> requests if the HTTP header field names are not in camel-case.
>
> That is, the server rejects if 'authorization' is given instead of '
> Authorization' in
> HTTP header field.
>
> Code :
> inets:start().
> http:request(get,{"http://10.37.184.222:20080/",[{"Authorization",
> "Basic dGVqYXM6adcnZSMwNXQ="}]},[],[]).
>
> *Erlang http module always sends the HTTP header field names in
> lower-case*.
> This is true even if the Headers are supplied as above in camel-case.
>
> Is this is a bug ?
> HTTP/1.1 and HTTP/1.0 complaint servers are supposed to handle header
> field names in a case-insensitive manner. So sending header field name in
> lower case is
> perfectly alright . But changing a as-is supplied header filed name to
> lower case makes it impossible to work with an non-complaint web
> server.
>
> regards,
> Anish
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110424/2b06bec7/attachment.htm>
More information about the erlang-questions
mailing list