ycdl/frontends/ycdl_flask/backend/jsonify.py

9 lines
244 B
Python
Raw Normal View History

import flask
import json
def make_json_response(j, *args, **kwargs):
dumped = json.dumps(j)
response = flask.Response(dumped, *args, **kwargs)
response.headers['Content-Type'] = 'application/json;charset=utf-8'
return response