Skip to content

Commit

Permalink
Update helper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandorf committed Aug 6, 2023
1 parent d0a9042 commit 85a7622
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions robin_stocks/robinhood/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,10 @@ def request_post(url, payload=None, timeout=16, json=False, jsonify_data=True):
'Content-Type', 'application/x-www-form-urlencoded; charset=utf-8')
else:
res = SESSION.post(url, data=payload, timeout=timeout)
if res.status_code == 400:
print("Error in request_post status_code 400", file=get_output())
else:
if res.status_code not in [200, 201, 202, 204, 301, 302, 303, 304, 307, 400, 401, 402, 403]:
raise Exception("Received "+ str(res.status_code))
data = res.json()
except Exception as message:
# Either return response <200,401,etc.> or the data that is returned from requests.
print("Error in request_post: {0}".format(message), file=get_output())
if jsonify_data:
return(data)
Expand Down

0 comments on commit 85a7622

Please sign in to comment.