码迷,mamicode.com
首页 > 其他好文 > 详细

Request

时间:2018-08-17 14:22:05      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:param   params   bsp   bin   get   amp   ams   col   ram   

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

标签:param   params   bsp   bin   get   amp   ams   col   ram   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!