flask:得到post的数组参数

一,代码:

@api.route('/testpost', methods=['POST'])
def test_post():
    foods = request.values.get('foods')
    print(foods)
    foods1 = request.values.getlist('foods')
    print(foods1)

二,postman

image

三,查看效果:

image 

 

posted @ 2026-02-19 19:22  刘宏缔的架构森林  阅读(2)  评论(0)    收藏  举报