request.args
returns a MultiDict
. It can have multiple values for each key. In order to print all parameters, you can try:The code below works for URLs with parameters added,like:
http://www.webservice.my/rest?extraKey=extraValue
multi_dict = request.args
for key in multi_dict:
print multi_dict.get(key)
print multi_dict.getlist(key)
For parameters embedded within the POST request as a form:dict = request.form
for key in dict:
print 'form key '+dict[key]
See the example here and you will have a good idea.
No comments:
Post a Comment