Skip to content

Commit

Permalink
Allow custom transports to be passed to Python's XML-RPC library.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maxcutler committed Jun 29, 2014
1 parent c1cdc73 commit 02017dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wordpress_xmlrpc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class Client(object):
`XmlrpcMethod`-derived class to `Client`'s `call` method.
"""

def __init__(self, url, username, password, blog_id=0):
def __init__(self, url, username, password, blog_id=0, transport=None):
self.url = url
self.username = username
self.password = password
self.blog_id = blog_id

try:
self.server = xmlrpc_client.ServerProxy(url, allow_none=True)
self.server = xmlrpc_client.ServerProxy(url, allow_none=True, transport=transport)
self.supported_methods = self.server.mt.supportedMethods()
except xmlrpc_client.ProtocolError:
e = sys.exc_info()[1]
Expand Down

0 comments on commit 02017dd

Please sign in to comment.