summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-02-22 09:10:54 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-02-22 09:10:54 (GMT)
commit3e85838ee9e54c04d8f0fc337672dc9a10aa5e41 (patch)
treeaaf095a87ed5ce4e658c3e7f7ba1ec993006493c
parent35bb78ef7be0601e25a818cf3e1d1cdd40df7dbb (diff)
downloadcpython-3e85838ee9e54c04d8f0fc337672dc9a10aa5e41.zip
cpython-3e85838ee9e54c04d8f0fc337672dc9a10aa5e41.tar.gz
cpython-3e85838ee9e54c04d8f0fc337672dc9a10aa5e41.tar.bz2
Fix errors in XML-RPC client example code
* httplib.HTTP (deprecated and does not work) → HTTPConnection * Server (deprecated) → ServerProxy
-rw-r--r--Doc/library/xmlrpclib.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst
index 833dc7a..627a282 100644
--- a/Doc/library/xmlrpclib.rst
+++ b/Doc/library/xmlrpclib.rst
@@ -564,7 +564,7 @@ Example of Client Usage
except Error as v:
print "ERROR", v
-To access an XML-RPC server through a proxy, you need to define a custom
+To access an XML-RPC server through a HTTP proxy, you need to define a custom
transport. The following example shows how:
.. Example taken from http://lowlife.jp/nobonobo/wiki/xmlrpcwithproxy.html
@@ -578,7 +578,7 @@ transport. The following example shows how:
self.proxy = proxy
def make_connection(self, host):
self.realhost = host
- h = httplib.HTTP(self.proxy)
+ h = httplib.HTTPConnection(self.proxy)
return h
def send_request(self, connection, handler, request_body):
connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
@@ -587,7 +587,7 @@ transport. The following example shows how:
p = ProxiedTransport()
p.set_proxy('proxy-server:8080')
- server = xmlrpclib.Server('http://time.xmlrpc.com/RPC2', transport=p)
+ server = xmlrpclib.ServerProxy('http://time.xmlrpc.com/RPC2', transport=p)
print server.currentTime.getCurrentTime()