POST方式:
if request.method == 'POST': body_str = request.body.decode('utf-8') post_data = parse_qs(body_str) post_dict = {} for k, v in post_data.items(): post_dict[k] = v[0] print(post_dict['subject'], post_dict['trade_no'])
GET方式:
data_json = json.loads(request.body) price = data_json.get('price')
标签:传参,body,python,request,json,dict,post,data From: https://www.cnblogs.com/mentu21/p/16716544.html