如何用Python写一个http post请求
1个回答
展开全部
使用requests库就可以了:
pip install requests
payload = {'key1': 'value1', 'key2': 'value2'}
r = requests.post("http://httpbin.org/post", data=payload)
print(r.text)
然后参考这个网址:
http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests
http://docs.python-requests.org/en/latest/
pip install requests
payload = {'key1': 'value1', 'key2': 'value2'}
r = requests.post("http://httpbin.org/post", data=payload)
print(r.text)
然后参考这个网址:
http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests
http://docs.python-requests.org/en/latest/
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询