diff --git a/okex-python-sdk-api-v5/okex/client.py b/okex-python-sdk-api-v5/okex/client.py index 7e91174d..9e62c970 100644 --- a/okex-python-sdk-api-v5/okex/client.py +++ b/okex-python-sdk-api-v5/okex/client.py @@ -5,13 +5,12 @@ class Client(object): - def __init__(self, api_key, api_secret_key, passphrase, use_server_time=False, flag='1'): + def __init__(self, api_key, api_secret_key, passphrase, use_server_time=False): self.API_KEY = api_key self.API_SECRET_KEY = api_secret_key self.PASSPHRASE = passphrase self.use_server_time = use_server_time - self.flag = flag def _request(self, method, request_path, params): @@ -29,7 +28,7 @@ def _request(self, method, request_path, params): body = json.dumps(params) if method == c.POST else "" sign = utils.sign(utils.pre_hash(timestamp, method, request_path, str(body)), self.API_SECRET_KEY) - header = utils.get_header(self.API_KEY, sign, timestamp, self.PASSPHRASE, self.flag) + header = utils.get_header(self.API_KEY, sign, timestamp, self.PASSPHRASE) # send request response = None @@ -37,11 +36,11 @@ def _request(self, method, request_path, params): print("url:", url) # print("headers:", header) print("body:", body) - +#proxies parameter e.g.1087 if method == c.GET: - response = requests.get(url, headers=header) + response = requests.get(url, headers=header,proxies={'http': 'http://127.0.0.1:1087','https': 'https://127.0.0.1:1087'}) elif method == c.POST: - response = requests.post(url, data=body, headers=header) + response = requests.post(url, data=body, headers=header,pproxies={'http': 'http://127.0.0.1:1087','https': 'https://127.0.0.1:1087'}) # exception handle # print(response.headers)