Support » Everything else WordPress » XML-RPC newPost broke when site changed to https

  • Kchun

    (@kchun)


    Code was working fine until the wordpress.com blog changed to the remote site from http to https. Now it gives a 301 error when I try to remote post.

    I looked into the code and it appears that it strips off the http or https so I’m not getting why I can’t connect to the xmlrpc.php and get a 301 error.

    I’ve tried with several xml-rpc libraries including the WordPress class-xmlrpc.php to no avail. They all give 301 error (had to do a little code modification to find out what was really going on.)

    If I directly access https://Orlandolunes.wordpress.com/xmlrpc.php in a browser, it gives the proper message: “XML-RPC server accepts POST requests only.”

    I also tried giving it port 443 instead of 80.

    $client = new IXR_Client(https://Orlandolunes.wordpress.com/xmlrpc.php);
    
    	$content['title'] = "Karen Testing";
            $content['description'] = "test post";
    
            if (!$client->query('metaWeblog.newPost',443, $sUsername,$sPassword, $content, false))
            {
                die( 'Error while creating a new post' . $client->getErrorCode() ." : ". $client->getErrorMessage());
            }
            $ID =  $client->getResponse();
  • The topic ‘XML-RPC newPost broke when site changed to https’ is closed to new replies.