Closed ghost closed 2 years ago
The configuration has other attributes which you can set beyond initialization. Refer to its source code for details. For your case, it's proxy
and proxy_headers
I tried with the following:
config = Configuration(key=auth['gateio_api'],
secret=auth['gateio_secret']).proxy('http://127.0.0.1:3128')
But I get this error:
File "/mnt/Work/MyProject/src/lib/gateclient.py", line 34, in initialize_client
config = Configuration(key=auth['gateio_api'],
TypeError: 'NoneType' object is not callable
Can you add an example please?
config = Configuration(key='xxx', secret='xxx')
config.proxy = 'http://xxx'
# then use `config` to initialize your client
spot_api = SpotApi(ApiClient(config))
config = Configuration(key='xxx', secret='xxx') config.proxy = 'http://xxx' # then use `config` to initialize your client spot_api = SpotApi(ApiClient(config))
You're the best! Thank you! :)
How do I add a HTTP proxy when initializing my API client? Right now
Configuration
function is documented as the following:There's no place to add proxies! I'd appreciate a clear example code if possible. Thank you.