python-simple-rest-client icon indicating copy to clipboard operation
python-simple-rest-client copied to clipboard

Proxy support

Open michalmarczuk opened this issue 7 years ago • 1 comments

Hi, This is not an issue but feature request :)

Could you add proxy support? It will be easier to debug requests.

Thank you in advance.

michalmarczuk avatar Apr 27 '18 11:04 michalmarczuk

Because this repo uses Requests lib for sync requests you can use 2 ways for setting proxy.

  • Set environment variable HTTP_PROXY or\and HTTPS_PROXY. Documentation of Requests lib (Ctrl+F by word proxy)

  • Use additional argument 'proxies' while using your methods. For example I'll add here code from the last example of Quickstart page Instead of using default response = github_api.events.public_events(body=None, params={}, headers={}) You can use response = github_api.events.public_events(body=None, params={}, headers={}, proxies={'http':"http://user:[email protected]:3128/", 'https': "http://user:[email protected]:3128/"}) Syntax of proxies dict you can find in Requests lib documentation (Ctrl+F by word proxy)

MaLevi4 avatar Apr 22 '19 07:04 MaLevi4