http://docs.python-requests.org/zh_CN/latest/user/quickstart.html
示例一:
r = requests.get('https://api.github.com/events')
r是一个对象,可以从这个对象中获取我们想要的信息
示例二:
r = requests.post('http://httpbin.org/post', data = {'key':'value'})
示例三,以一个字符串字典来提供参数:
payload = {'key1': 'value1', 'key2': 'value2'} r = requests.get("http://httpbin.org/get", params=payload)
所有评论(0)