or download this
my $client = REST::Client->new();
$client->setHost($wiki);
...
$request .= '&format=json';
$request .= "&token=$token";
$client->POST($api, $request); # << separate path (e.g. "/mediawiki/ap
+i.php") from the request-params e.g. the ? part which is now in strin
+g $request.