I am using Flask Restful for my server API and am posting to the server a dictionary where one of the values is a list of dictionary's.
parser.add_argument('products_in_basket', type=list)
def post(self, user_id):
args = parser.parse_args()
print request.data
print args['my_list']
The problem I have is args['my_list'] is only returning the first element of the list. Whereas I can see all list from request.data.
This is request.data
{"address_id":1,"my_list":[{"size":12,"colour":"red","id":34219,"quantity":1},{"size":10,"colour":"red","id":12219,"quantity":2},{"size":8,"colour":"red","id":5214,"quantity":3}],"payment_card_id":1}
This is args['my_list']
[u'colour', u'quantity', u'id', u'size']
Where am I going wrong?