On Mon, 10 Mar 2008 10:15:17 -0600, Andrew McNabb <[EMAIL PROTECTED]> wrote:
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.
This seems like a slightly round-about API. What would you think of having another prefix which included the request as the first argument? Or the same prefix could be used and the function could have an attribute indicating it wants the request. Jean-Paul _______________________________________________ Twisted-web mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
