How to fix "XML-RPC server accepts POST requests only." error?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
nhchau's picture

I tried Services and it methods work, except XML-RPC. Testing XML-RPC with Drupal 6.10 (and 5.16) by click into http://mysite.com/services/xmlrpc I got the following message: "XML-RPC server accepts POST requests only."
How to fix this?

Comments

well thats because when you

snufkin's picture

well thats because when you click on the server link your browser does a GET request. To use the xmlrpc server you need to submit a POST request.

How to submit a POST request

karthick62's picture

How to submit a POST request , I mean at the code. since i am new bie to php as well as drupal, I could not figure it on where it must be enabled.
It would be great if i could get help from your side.

Why do you need the XML-RPC?

snufkin's picture

Why do you need the XML-RPC? Usually this is not something you use directly from the browser, its an API for programs and websites to communicate to each other (such as a blog editor you install on your desktop and it submits the post via XML-RPC). In everyday Drupal usage you don't need to bother about this whole thing.

It would help if you could explain what you are trying to do.

Needed info

karthick62's picture

Thanks for the reply!

Sorry snufkin, I didnt give you a exact info in my last post.This is what i am exactly wanna do , I have two drupal website instances. I need one drupal instance to communicate with another drupal instance.I am advised to use services module for this. The main aim is to let one of the drupal instances to retrieve the taxonomy related terms from another drupal instance thro xmlrpc.

when ever i click the Server -> XMLRPC -/service/xmlrpc (in the services module). It throws some error as XML-RPC server accepts POST requests only.When i went through few forums and discussions i have got a advise like in the link. ( for wordpress)

http://will.hughesfamily.net.au/20070513/wordpress-xml-rpc-server-accept...

someone advises like we need to upgrade the version of php we use. How should i proceed this?

What would $HTTP_RAW_POST_DATA mean?I googled a lot but cudnt pick up the concpet

Thanks again!!

No PHP upgrade needed

PieterDC's picture

I don't think you have to upgrade your PHP version.
The services URL isn't meant to be clicked on.
It's meant to POST requests to (as voxpelli explains).

The fact that you browse/surf to the URL sends a GET request.
As it only processes POST requests, you get an error message exactly stating that.

How should i proceed now with

karthick62's picture

How should i proceed now with enabling communication b/w two drupal sites using services module??

Thanks for the reply

Write your own or Deploy

PieterDC's picture

To call a service you'll need to program some processing code.
You can have a look within the Services module documentation pages http://drupal.org/node/113697

Or maybe the Deployment module does what you want? http://drupal.org/project/deploy

Using Deploy

karthick62's picture

I spent sometime with Deploy module and it provided most of the needed work.I deployed a taxonomy term from one of the instances and it got deployed to another instance but only the root vocabulary not the full hierarchy.Hope if spend some more time i could get things i really needed..
Thanks for the great info Pieter. :p

As snufkin says - XML-RPC

voxpelli's picture

As snufkin says - XML-RPC does all it requests as POST-requests which comes with a couple of disadvantages (and probably some advantages).

I like the REST-approach better where the HTTP-methods GET, POST, PUT and DELETE are used to their full extent. Another guy at my company has added great support for that to services but are having trouble getting the necessary changes to the services module reviewed and committed to the module.

Check out this comment for his view on the state of REST and what you can do to help: http://drupal.org/node/438804#comment-1515410

Pelle Wessman - Good Old

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week