cyclone.xmlrpc — XML-encoded Remote Procedure Call

Server-side implementation of the XML-RPC protocol.

XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism.

For more information, check out the RPC demo.

class cyclone.xmlrpc.XmlrpcRequestHandler(application, request, **kwargs)[source]

Subclass this class and define xmlrpc_* to make a handler.

Example:

class MyRequestHandler(XmlrpcRequestHandler):
    allowNone = True

    def xmlrpc_echo(self, text):
        return text

    def xmlrpc_sort(self, items):
        return sorted(items)

    @defer.inlineCallbacks
    def xmlrpc_geoip_lookup(self, address):
        response = yield cyclone.httpclient.fetch(
            "http://freegeoip.net/xml/%s" % address.encode("utf-8"))
        defer.returnValue(response.body)

Previous topic

cyclone.sse — Server-Sent Events

Next topic

cyclone.jsonrpc — JSON-encoded Remote Procedure Call

This Page