I have the following code:
my $j = encode_json { "arguments" => { "peer-port" => "4444" }, "method" => "session-set", };
$mech->get('http://192.168.1.10:9091');
my $req = HTTP::Request->new( 'POST', 'http://192.168.1.10:9091/transmission/rpc' );
$req->header( 'Content-Type' => 'application/json' );
$req->content($j);
$mech->request($req);
When it runs, I get the following error:
Error POSTing http://192.168.1.10:9091/transmission/rpc: Conflict at ./pia.pl line 48.
I am unable to find anything on this specific error, nor am I able to find anything in WWW::Mechanize's documentation (or HTTP::Request's) that sheds any light on it. The script has no problem doing proper form submissions, it only fails on this one (where the target http server only accepts ajax/json requests apparently).