I've made a simple extension to XMLRPC, and I was wondering if it is
something that I should contribute back to Twisted or if I should keep
it to myself.  In other words, would others find this useful?

The idea is that RPC methods might need to get at information in the
request.  For example, an RPC method might need to know what IP address
the request comes from or it might need to know if HTTP basic
authentication is set.  I'm sure I could come up with more examples.

Here how it's used:

class SomeXMLRPCClass(XMLRPC):
    def keywords(self, request):
        return {'client': request.client}

    def xmlrpc_echo(self, x, **kwds):
        client = kwds['client']
        # [do what you need to with client here]
        return x

Anyway, implementing this is incredibly simple, and I needed it for a
project I'm working on.  If it would be useful to others, I'd be happy
to create a ticket and post a patch.

Thanks.

-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868

Attachment: pgpbDXhClxzfo.pgp
Description: PGP signature

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to