Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions okex-python-sdk-api-v5/okex/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -29,19 +28,19 @@ 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

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)
Expand Down