RPC::Any::Server::XMLRPC::HTTP - An XML-RPC server that understands HTTP
use RPC::Any::Server::XMLRPC::HTTP; # Create a server where calling Foo.bar will call My::Module->bar. my $server = RPC::Any::Server::XMLRPC::HTTP->new( dispatch => { 'Foo' => 'My::Module' }, send_nil => 0, allow_get => 0, ); # Read from STDIN and print result, including HTTP headers, to STDOUT. print $server->handle_input(); # HTTP servers also take HTTP::Request objects, if you want. my $request = HTTP::Request->new(POST => '/'); $request->content('<?xml ... '); print $server->handle_input($request);
This is a type of RPC::Any::Server::XMLRPC that understands HTTP. It has all of the features of RPC::Any::Server, RPC::Any::Server::XMLRPC, and RPC::Any::Interface::HTTP. You should see those modules for information on configuring this server and the way it works.
For the most part, this implementation ignores HTTP headers on input. However, it can be helpful to specify charset=UTF-8 in your Content-Type request header if you want Unicode to be handled properly.
charset=UTF-8
There is no support for HTTP GET in the normal XML-RPC spec. However, if you have allow_get set to 1, then this server will accept a query string that is raw (URI-escaped) XML as its XML-RPC input, during GET requests. So, for example, you could call GET on a URL like:
allow_get
/?%3C%3Fxml%20version%3D%221.0%22%3E%3CmethodCall%3E...
(That query string is the url-escaped version of <?xml version="1.0"><methodCall>....)
<?xml version="1.0"><methodCall>...
To install RPC::Any, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPC::Any
CPAN shell
perl -MCPAN -e shell install RPC::Any
For more information on module installation, please visit the detailed CPAN module installation guide.