Main menu:


Add to Google

Subscribe via e-mail:


Site search

Categories

June 2007
M T W T F S S
« May   Jul »
 123
45678910
11121314151617
18192021222324
252627282930  

Archive

WordPress "XML-RPC server accepts POST requests only."

This morning I found I couldn’t publish to WordPress using Windows Live Writer any more. I would get errors like “Invalid Server Response – The response to the blogger.getUsersBlogs method received from the weblog server was invalid.” and when I looked at the request in HTTPAnalyzer, WordPress’s xmlrpc.php was sending “XML-RPC server accepts POST requests only.”, even though I WAS posting. Since WordPress’s WSYWIG and HTML editors both horribly mangle any code samples you try to use, this was quite frustrating.

But after a bit of Googling, I found a quick solution that worked perfectly. Just add the following line of PHP to the top of your xmlrpc.php file (inside the <?php of course):

$HTTP_RAW_POST_DATA = file_get_contents("php://input");

Thanks to helpful bloggers like Will for reporting solutions to problems like this, and thanks to Google for helping other distressed hackers find them! I hope this increases the ease with which this particular solution can be found by others.

  • http://terrychay.com/blog/ terry chay

    I think the issue is I had Marc running us on PHP5 but WordPress isn’t listed as compatible with PHP5.

    Dreamhost must have done an upgrade silently.

  • http://terrychay.com/blog/ terry chay

    btw, your code is smartquoted.

  • http://will.hughesfamily.net.au Will

    Hi Joseph – good to see it’s helping other people.

  • http://www.rickscheibner.net Rick

    Joseph, I’m having this same problem. There’s already a similar line in the xmlrpc.php file in WP 2.2, but it’s syntaxed just a little differently. Do I add this one, in addition to the one that’s already in there?

  • http://www.josephsmarr.com jsmarr

    Rikk-not sure what to tell you. I’m pre-2.1, so the same fix might not work for you. Are you sure you’re getting the exact same error message? My advice is to do what I did–google around and hope some nice fellow blogger like Will has diagnosed your same problem and posted a solution. And if you do figure it out, be sure to post it back for the next victim. ;) js

  • http://pharma911.co.tv Ferul

    hello!