Subject: | REST::Client rewriting headers |
Date: | Thu, 30 Jan 2014 16:24:58 -0500 |
To: | <bug-REST-Client [...] rt.cpan.org> |
From: | Robert Israel <robert.israel [...] teamaol.com> |
Hello!
When using REST::Client, when specifying header fields as "user_name"
and "license_key", they get rewritten as "User-Name" and "License-Key",
with poor results in servers that care about capitalization and
underscores not being dashes. For example, this code:
my $headers = {Accept => 'application/json', 'Content-type' =>
'application/json', 'user_name' => $username, 'license_key' => $password };
results in the following going over the wire (examined via tcpdump) to
the remote server:
Accept: application/json
Host: {redacted}
User-Agent: REST::Client/171
Content-Length: 0
Content-Type: application/json
License-Key: {redacted}
User-Name: {redacted}
As you can see, license_key has become License-Key, and user_name has
become User-Name. This prevents me from authenticating. Using curl,
which does not change the case/underscores, things work properly.
Thank you!
-Rob