What i want is to handle an order placed to a server from an android app.
To test things i am using POSTMAN.
I tested it
with the following code.
class newOrder(Resource):
'''
this class receives credentials from a post request
and returns the full menu of the establishment.
'''
def post(self):
try:
parser = reqparse.RequestParser()
parser.add_argument('username', type=str, help='Password to create user')
parser.add_argument('password', type=str, help='Email address to create user')
args = parser.parse_args()
_userUsername = args['username']
_userPassword = args['password']
return jsonify({'username':_userUsername,'password':_userPassword})
except Exception as e:
return {'error': str(e)}
and got this.
So far so good
how can i alter this to work and be tested on POSTMAN and return the following?
{'usename':'foo','password':'bar',
"order":
[
[1,"ΚΡΗΤΙΚΗ",5,,'tt'],
[2,"ΣΑΛΑΤΑ","ΦΑΚΗ",6,'tt'],
[3,"ΣΑΛΑΤΑ","ΚΟΥΣ-ΚΟΥΣ",5,'tt'],
]
}
i am having trouble with the list. 'order':[[],[],[],...]
How to i enter that list to POSTMAN parameters?
Also, i am returning it to my self to simply view it. i just want to know that the data was entered properly.
Thank you.