首页 > 其他 > 详细

Request

时间:2018-08-17 14:12:15      阅读:137      评论:0      收藏:0      [点我收藏+]

requests的基本使用:

response = requests.get("http://httpbin.org")

带参数的get请求:

方法1:
response = requests.get("http://httpbin.org/get?name=gemey&age=22")    # 参数和地址用?号隔开,参数之间用&连接

方法2:
data = {"name":"germey","age":22}
response = requests.get("http://httpbin.org/get",params=data)
print(response.text)

 

Request

原文:https://www.cnblogs.com/sq5288/p/9492948.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!