I'm trying to use the Perl module RPC::XML::Client to handle the XMLRPC API of Dokuwiki. In another SO post, the XMLRPC API of Dokuwiki was suggested as a way to programmatically post pages..
I'm not sure what I'm doing wrong, but I'm not able to log on using this code:
#!/bin/env perl
package PostWiki;
use 5.010; # Require at least Perl version 5.10
use strict; # Must declare all variables before using them
use warnings; # Emit helpful warnings
use autodie; # Fatal exceptions for common unrecoverable errors (e.g. open)
use RPC::XML::Client;
my $client = RPC::XML::Client->new('http://example.com/wikiname/lib/exe/xmlrpc.php');
my $logged_on_ok = $client->send_request('dokuwiki.login','username','password');
my $res = $client->send_request('dokuwiki.getVersion');
print $res;
I get this error:
RPC::XML::Client::send_request: HTTP server error: Unauthorized
I log into the page manually using the same username and password, so that should not be the issue.
I have remoteuser
set to the same username that I use to log onto the wiki to make manual edits. (For security purposes, this is not the same as the administrator user).
I also have securecookie
unchecked, since anyone is free to browse the site, even though only a few can edit it. But it also didn't work when I had it checked.
I don't have access to the server itself except through the wiki, otherwise I could simply copy the files to the server.