Main menu:


Subscribe with Bloglines

Subscribe via e-mail:

Twitter Status

My Twitter Feed
RT @thesocialwebtv: New episode: "The Social Web and the Loss of a Pop Star" w/ special guest @kevinmarks: http://bit.ly/AxEg1 #MrsMiller
1 day ago

Xobni outlook add-in for your inbox

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.

Comments

Comment from terry chay
Time: June 7, 2007, 5:58 am

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.

Comment from terry chay
Time: June 7, 2007, 5:59 am

btw, your code is smartquoted.

Comment from Will
Time: June 9, 2007, 4:11 pm

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

Comment from Rick
Time: June 10, 2007, 8:38 am

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?

Comment from jsmarr
Time: June 10, 2007, 6:54 pm

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

Write a comment