Flask API TypeError: Object of type 'Response' is not JSON serializable

后端 未结 4 1692
栀梦
栀梦 2021-02-12 11:41

i have a problem with Python Flask Restful API and data goes to Elasticsearch, when i post a new data with Postman, problem is:

TypeError: Object of type \'Response\' is

4条回答
  •  孤街浪徒
    2021-02-12 12:21

    def post(self):
        some_json=request.get_json()
        return jsonify({'you sent ':some_json})
    

    enough to solve this issue

提交回复
热议问题