标签:python requests post urlencode
这两天要为公司一个项目的服务端写性能测试脚本,其中有一个请求订单号的接口,需要客户端用post请求向服务端发送加密过的token 和订单数据。代码如下:
payload = {‘token‘:token,‘order_data‘:order_data}
r = requests.post(url, data=payload}
但是,服务端返回错误,花了很长时间检查了token和order_data的加密算法,确认没错;
查了下文档,上面有这样一句话:
There are many times that you want to send data that is not form-encoded. If you pass in a string instead of a dict, that data will be posted directly.
[python]如何在requests post时不做urlencode?,布布扣,bubuko.com
[python]如何在requests post时不做urlencode?
标签:python requests post urlencode
原文地址:http://blog.csdn.net/u012973744/article/details/27187253