python-wordpress-xmlrpc icon indicating copy to clipboard operation
python-wordpress-xmlrpc copied to clipboard

Proxy support added to Client class.

Open ghost opened this issue 11 years ago • 4 comments

ghost avatar May 26 '13 10:05 ghost

In version 2.3 I've exposed a transport parameter that you can pass with your custom transports. I'm not sure it makes sense to bundle particular transports in the library, but you should feel free to put it in a separate package and upload it to PyPI for easy sharing and consumption.

maxcutler avatar Jun 29 '14 20:06 maxcutler

Hello Max,

Have you had a time to fix the proxy issue ? I need to use the code via proxy, could you help me please. Thank you.

Emad-AiDev avatar Oct 20 '14 14:10 Emad-AiDev

In my previous comment I said that I released version 2.3 with a new 'transport' parameter to the constructor that allows you to pass your own transports. You can even use the ProxiedTransport you had included in this pull request.

I haven't merged this PR because I'm not yet comfortable shipping transports as part of the core library itself. So instead I've made it simpler for users to supply their own.

maxcutler avatar Oct 20 '14 14:10 maxcutler

I am getting following error when using ProxiedTransport on python 2.7.

Traceback (most recent call last):
  File "wp_post.py", line 33, in <module>
    wp = Client('http://www.example.com/xmlrpc.php', 'user', 'password', transport=p)
  File "/usr/local/lib/python2.7/dist-packages/wordpress_xmlrpc/base.py", line 24, in __init__
    self.supported_methods = self.server.mt.supportedMethods()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1294, in single_request
    response = h.getresponse(buffering=True)
AttributeError: HTTP instance has no attribute 'getresponse'

gagandeep avatar Oct 29 '14 06:10 gagandeep