How to submit a valid JSON request using perl mechanize module
I tried
use WWW::Mechanize;
use JSON;
my $mech=WWW::Mechanize->new(
stack_depth => 10,
timeout => 120,
autocheck => 0,
);
$mech->agent_alias( 'Windows Mozilla' );
my $json = '{"jsonrpc":"2.0","id":1,"params":{"query": {"limit":2000,"start":0,"orderBy":[{"columnName":"osName","direction":"Asc"}]},"refresh":true}}';
$url ="http://path/to/url/";
$mech->post($url,$json);
and the result does not come as expected It always parse json error.
So an I doing it right by just posting $mech->post($url,$cjson);
or should I do / add something else?