Skip to content

Commit 02017dd

Browse files
committed
Allow custom transports to be passed to Python's XML-RPC library.
Custom transports have the ability to modify the network behavior of the HTTP requests, to do things like proxying (see #41), timeouts (see #52), SSL certification validation (see #60), and more. Fixes #61.
1 parent c1cdc73 commit 02017dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wordpress_xmlrpc/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ class Client(object):
1313
`XmlrpcMethod`-derived class to `Client`'s `call` method.
1414
"""
1515

16-
def __init__(self, url, username, password, blog_id=0):
16+
def __init__(self, url, username, password, blog_id=0, transport=None):
1717
self.url = url
1818
self.username = username
1919
self.password = password
2020
self.blog_id = blog_id
2121

2222
try:
23-
self.server = xmlrpc_client.ServerProxy(url, allow_none=True)
23+
self.server = xmlrpc_client.ServerProxy(url, allow_none=True, transport=transport)
2424
self.supported_methods = self.server.mt.supportedMethods()
2525
except xmlrpc_client.ProtocolError:
2626
e = sys.exc_info()[1]

0 commit comments

Comments
 (0)