Subject: | HTTP::Headers not working if header has “:” in it comes as Illegal field name . |
Date: | Fri, 3 Jan 2014 16:55:19 +0000 |
To: | "bug-HTTP-Message [...] rt.cpan.org" <bug-HTTP-Message [...] rt.cpan.org> |
From: | "Bambah, Avnit" <avnit.bambah [...] nb.com> |
Subject : HTTP::Headers not working if header has “:” in it comes as Illegal field name .
Sample code that will not work
my $list_request = HTTP::Request->new( POST => $list_request_api );
$list_request->content_type('application/json');
$list_request->header( "Authorization:Bearer" => $final->{access_token},
"Accept" => "application/json" );
$list_request->content($security_list);
eval { $list_results = $List_agent->request($list_request) };
$@ and warn "Exception when requesting data : $@\n";
Module code that causes this .
Headers.pm
Carp::croak("Illegal field name '$field'")
if rindex($field, ':') > 1 || !length($field);
Thanks
Avnit Bambah
Message body is not shown because sender requested not to inline it.