A working example with http auth.
#!/usr/bin/perl use strict; use warnings; use MediaWiki::API;
my $mw = MediaWiki::API->new();
sub on_error() { print "Error code: " . $mw->{error}->{code} . "\n"; print $mw->{error}->{stacktrace}."\n"; die; }
$mw->{config}->{api_url} = 'http://hello:world@testwiki.exotica.org.uk/mediawiki/api.php'; $mw->{config}->{on_error} = &on_error;
use Data::Dumper; print Dumper $mw->get_page( { title => 'Main Page' } );