美文网首页
python xhr post请求

python xhr post请求

作者: 青铜搬砖工 | 来源:发表于2019-06-05 10:27 被阅读0次

1.content_type 为 application/x-www-form-urlencoded
response = requests.post(url, data=form_data, headers=header)
form_data不要变为json字符串 需要字典格式

2.content_type 为application/json
import json
response = requests.post(url, data=json.dumps(form_data), headers=header)
form_data必须变为json字符串,否则报错

相关文章

网友评论

      本文标题:python xhr post请求

      本文链接:https://www.haomeiwen.com/subject/vcdjxctx.html