Flask Python, trying to return list or dict to Ajax call

后端 未结 3 1842
不知归路
不知归路 2021-02-05 04:21

Within a Flask app, I have the following ajax call:

    $.ajax({
            url: \"{{ url_for( \'bookings.get_customer\' ) }}\",
            type: \"POST\",
            


        
3条回答
  •  醉酒成梦
    2021-02-05 04:40

    You need to do

    return jsonify(result=your_result)
    

    Also check documentation which could be really helpful.

提交回复
热议问题