Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json encoding deprecated #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions huobi/connection/impl/restapi_invoker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def call_sync(request, is_checked=False):
response = session.get(request.host + request.url, headers=request.header)
if is_checked is True:
return response.text
dict_data = json.loads(response.text, encoding="utf-8")
dict_data = json.loads(response.text)
# print("call_sync === recv data : ", dict_data)
check_response(dict_data)
return request.json_parser(dict_data)

elif request.method == "POST":
response = session.post(request.host + request.url, data=json.dumps(request.post_body), headers=request.header)
dict_data = json.loads(response.text, encoding="utf-8")
dict_data = json.loads(response.text)
# print("call_sync === recv data : ", dict_data)
check_response(dict_data)
return request.json_parser(dict_data)
Expand All @@ -76,7 +76,7 @@ def call_sync_perforence_test(request, is_checked=False):
req_cost = response.elapsed.total_seconds()
if is_checked is True:
return response.text
dict_data = json.loads(response.text, encoding="utf-8")
dict_data = json.loads(response.text)
# print("call_sync === recv data : ", dict_data)
check_response(dict_data)
return request.json_parser(dict_data), req_cost, cost_manual
Expand All @@ -87,7 +87,7 @@ def call_sync_perforence_test(request, is_checked=False):
inner_end_time = time.time()
cost_manual = round(inner_end_time - inner_start_time, 6)
req_cost = response.elapsed.total_seconds()
dict_data = json.loads(response.text, encoding="utf-8")
dict_data = json.loads(response.text)
# print("call_sync === recv data : ", dict_data)
check_response(dict_data)
return request.json_parser(dict_data), req_cost, cost_manual