What steps will reproduce the problem?
use strict;
use warnings;
use Test::More;
use Test::WWW::Mechanize;
my $client = Test::WWW::Mechanize->new;
my $url = 'http://localhost/search';
my $headers = {'Content-Type' => 'application/x-www-form-urlencoded', Accept => 'application/json'};
my $data = 'query=server-management&limit=1';
$client->post_ok( $url, { %$headers, Content => $data });
note $client->content;
done_testing;
What is the expected output? What do you see instead?
Expected
{"params":["query","limit"],"query":"server-management","Accept":"application/json","limit":"1"}
Instead
{"params":["Accept","Content-Type","Content"],"query":"","Accept":"","limit":""}
What version of the product are you using? On what operating system?
1.72 Linux/Windows both
Please provide any additional information below.
the problem is at
https://metacpan.org/source/PETDANCE/Test-WWW-Mechanize-1.44/Mechanize.pm#L236
LWP::Useragent->post expects an array (or url + hash) not a url + hashref. removing the \ from %opts fixes the problem
XenoTerr...@gmail.com reported on Mar 21, 2013
Details
Imported from Google Code issue 245 via archive