Anish,<div><br></div><div>Try this:</div><div> <meta charset="utf-8">http:request(get,{"<a href="http://10.37.184.222:20080/" target="_blank">http://10.37.184.222:20080/</a>",[{"Authorization", "Basic dGVqYXM6adcnZSMwNXQ="}]},[],[{headers_as_is, true}]).</div>
<meta charset="utf-8"><div><br><div class="gmail_quote">On Sun, Apr 24, 2011 at 3:47 PM, Anish Parameswaran <span dir="ltr"><<a href="mailto:anishparameswaran@gmail.com">anishparameswaran@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi , <br><br>I am new to Erlang . <br><br>I use the following code to access a web server . The web server doesn't service <br>
requests if the HTTP header field names are not in camel-case. <br><br>That is, the server rejects if 'authorization' is given instead of ' Authorization' in <br>
HTTP header field. <br><br>Code : <br> inets:start().<br> http:request(get,{"<a href="http://10.37.184.222:20080/" target="_blank">http://10.37.184.222:20080/</a>",[{"Authorization", "Basic dGVqYXM6adcnZSMwNXQ="}]},[],[]).<br>
<br><b>Erlang http module always sends the HTTP header field names in lower-case</b>. <br>This is true even if the Headers are supplied as above in camel-case. <br><br>Is this is a bug ? <br>HTTP/1.1 and HTTP/1.0 complaint servers are supposed to handle header <br>
field names in a case-insensitive manner. So sending header field name in lower case is <br>perfectly alright . But changing a as-is supplied header filed name to <br>lower case makes it impossible to work with an non-complaint web server. <br>
<br>regards,<br><font color="#888888">Anish<br><br><br>
</font><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>