Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0d34530f
Commit
0d34530f
authored
Feb 22, 2016
by
Martin Panter
Browse files
Options
Browse Files
Download
Plain Diff
Merge XML-RPC client documentation from 3.5
parents
42b33a4d
1c5e715d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Doc/library/xmlrpc.client.rst
Doc/library/xmlrpc.client.rst
+4
-4
No files found.
Doc/library/xmlrpc.client.rst
View file @
0d34530f
...
...
@@ -541,7 +541,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
...
...
@@ -555,16 +555,16 @@ transport. The following example shows how:
self.proxy = proxy
def make_connection(self, host):
self.realhost = host
h = http.client.HTTP(self.proxy)
h = http.client.HTTP
Connection
(self.proxy)
return h
def send_request(self, connection, handler, request_body):
def send_request(self, connection, handler, request_body
, debug
):
connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
def send_host(self, connection, host):
connection.putheader('Host', self.realhost)
p = ProxiedTransport()
p.set_proxy('proxy-server:8080')
server = xmlrpc.client.Server('http://time.xmlrpc.com/RPC2', transport=p)
server = xmlrpc.client.Server
Proxy
('http://time.xmlrpc.com/RPC2', transport=p)
print(server.currentTime.getCurrentTime())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment