From 8571045b9470d3fd2beff982bc7f89a013b2f21c Mon Sep 17 00:00:00 2001 From: burris Date: Tue, 3 Sep 2002 08:22:22 +0000 Subject: [PATCH] made user agent string a variable --- xmlrpcclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmlrpcclient.py b/xmlrpcclient.py index 866039f..230f3ad 100644 --- a/xmlrpcclient.py +++ b/xmlrpcclient.py @@ -4,11 +4,12 @@ from twisted.internet.defer import Deferred from xmlrpclib import loads, dumps +USER_AGENT = 'Python/Twisted XMLRPC 0.1' class XMLRPCClient(HTTPClient): def connectionMade(self): payload = dumps(self.args, self.method) self.sendCommand('POST', '/RPC2') - self.sendHeader('User-Agent', 'Python/Twisted XMLRPC 0.1') + self.sendHeader('User-Agent', USER_AGENT) self.sendHeader('Content-Type', 'text/xml') self.sendHeader('Content-Length', len(payload)) self.endHeaders() -- 2.39.5