UPDATE (FIGURED OUT):
I figured this out on my own, this is not documented anywhere. The array reference passed needs to have each array item be a hash reference using either the a categoryName or categoryId key identifier. Meaning:
'categories' => [ {'categoryName' => 'CatName1'}, {'categoryName' => 'CatName2'}, ],
The question below no longer needs answering...
The following code works fine to upload a new post to a WordPress blog but for the life of me I can't seem to get the categories to be set.
The categories exist. I've tried all lower case, tried case-matching, tried the slug version. Nothing works. No matter how I try passing the categories, the post gets assigned only to the default category.
I've scoured the web to find other pieces of sample code and none mention the actual code semantics of how to assign post to certain categories using the WordPress::XMLRPC module.
use WordPress::XMLRPC; my $o = WordPress::XMLRPC->new; $o->username('username'); $o->password('password'); $o->proxy('http://blogdomain.com/xmlrpc.php'); $o->server() || die "$!"; my $hashref = { 'title' => 'Test New Post 999 555456782', 'categories' => ['Categorie1', 'Categorie2'], 'description' => '<p>Here is the content</p>', 'mt_keywords' => 'tag1, tag2, tag3', 'mt_allow_comments' => 1, }; my $ID = $o->newPost($hashref, 1);