Flask_Movie_Website
Flask_Movie_Website copied to clipboard
replacing json.dumps with flask jsonify helper wrapper
Hi Henry,
We have a free program analysis tool for Python based web projects, called Bento. While we were scanning GitHub projects for issues, your project triggered a warning for using json.dumps() instead of flask jsonify().
According to this Stackoverflow article (https://stackoverflow.com/questions/7907596/json-dumps-vs-flask-jsonify), the jsonify() function in flask returns a flask.Response() object that already has the appropriate content-type header 'application/json' for use with json responses. It also has support for handling multiple args / kwargs, including lists. Hopefully, you'll find this PR useful.
Bento flagged few other issues related to Python3 compatibility, but I didn't want to touch those issues in this PR. If you are interested, feel free download and give Bento a try (https://bento.dev).