Reputation: 91
I have an example parse request list dictionary:
{
"shopping_cart": [{
"id": 23323,
"qty": 10
}, {
"id": 34232,
"qty": 9
}, {
"id": 34232,
"qty": 9
}]
}
How can i parse it use flask_restful RequestParser ?
Upvotes: 8
Views: 4198
Reputation: 329
Use something like this :)
self.postreqparse = reqparse.RequestParser()
self.postreqparse.add_argument("shopping_cart", type=dict, action="append")
Upvotes: 15