Dear Monks, I am trying to use WordPress::XMLRPC to post to a blog. It appears to be very easy to do, and my code is:
use strict; use warnings; use WordPress::XMLRPC; my $wp = WordPress::XMLRPC->new({ username => '...', password => '...', proxy => 'http://.../blog/xmlrpc.php', }); $wp->server or die; my $xx = $wp->getCategories(); print STDERR $wp->errstr if $wp->errstr; use Data::Dumper; die Dumper( $wp );
When I run it, it says
# WordPress::XMLRPC::getCategories() - ERROR faultString, Bad login/pa +ss combination. # WordPress::XMLRPC::getCategories() - ERROR faultCode, 403 $VAR1 = bless( { 'errstr' => '# WordPress::XMLRPC::getCategories() - E +RROR faultString, Bad login/pass combination. # WordPress::XMLRPC::getCategories() - ERROR faultCode, 403 ', 'password' => '...', 'blog_id' => 1, 'server' => bless( { ...and a lot more...
I have checked very carefully. I can log in with the username password to the website. The xmlrpc.php file is located in the blog directory. When I enter the url to xmlrpc.php, in a browser, I get "XML-RPC server accepts POST requests only." (which indicates that the url is correct). I entered the same server, username and password to "Windows Live Writer", just to check (because that must also use XMLRPC calls) and that had no problems logging in to the site. So why does this code say "bad login/pass combination"?

In reply to Wordpress::XMLrpc problem by b4swine

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.