我有一个解析请求列表字典的示例:
{
"shopping_cart": [{
"id": 23323,
"qty": 10
}, {
"id": 34232,
"qty": 9
}, {
"id": 34232,
"qty": 9
}]
}
Run Code Online (Sandbox Code Playgroud)
我如何使用flask_restful RequestParser解析它?
小智 6
使用这样的东西:)
self.postreqparse = reqparse.RequestParser()
self.postreqparse.add_argument("shopping_cart", type=dict, action="append")
Run Code Online (Sandbox Code Playgroud)