我有一个示例解析请求列表字典:
{
"shopping_cart": [{
"id": 23323,
"qty": 10
}, {
"id": 34232,
"qty": 9
}, {
"id": 34232,
"qty": 9
}]
}
我如何使用flask_restful RequestParser解析它?
最佳答案
使用这样的东西:)
self.postreqparse = reqparse.RequestParser()
self.postreqparse.add_argument("shopping_cart", type=dict, action="append")
关于rest - Flask Restful 解析器列表字典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35764851/