You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create_watchlist function I needed to change the _make_request call, previously it was using PUT and data=payload, this was throwing strange errors. the new code I used is _return self.make_request(method='post', endpoint=endpoint, mode='json', json=payload,order_details=False)
_make_request function I needed to check for additional response codes and non-json responses for example delete_watchlist returns a 204 with nobody - below is the code that I added into the _make_request function. PS print statements are for testing.
If it's okay and no details.
elif response.ok:
json_content_type = False
try :
json_content_type = response.headers["content-type"].strip().startswith("application/json")
except KeyError :
json_content_type = False
if (
response.status_code != 204 and
json_content_type
):
try:
return response.json()
except ValueError:
raise ValueError
# decide how to handle a server that's misbehaving to this extent
else:
print("response.status_code : " + str(response.status_code))
print("response headers" + str(response.headers))
print("response json" + str(response.request.body))
response_dict = {
'headers': response_headers,
'content': response.content,
'status_code': status_code,
'request_body': response.request.body,
'request_method': response.request.method
}
print (response_dict)
return response_dict
else:
The text was updated successfully, but these errors were encountered:
There are two errors I discovered in client.py
If it's okay and no details.
The text was updated successfully, but these errors were encountered: