stypr / clubhouse-py

Clubhouse API written in Python. Standalone client included. For reference and education purposes only.

Home Page:https://pypi.org/project/clubhouse-py/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

req.json() is a weak point

yegorov-p opened this issue · comments

I really don't like the part with

req = requests.post(smth)
return req.json()

It can cause so many problems, server can return 50* and it will break .json() method, server can theoretically return "bad" json and so on.

What do you think about idea to at least start validating response headers, or (better!) check if server response is a correct JSON. I can make a PR if you approve the idea.

I will change it at some point. I think there are more serious things than this though.