requests.request() 方法解析

(1)request 参数说明

params={'q': 'python', 'cat': '1001'}
data={'form_email': 'abc@example.com', 'form_password': '123456'}
params = {'key': 'value'}
requests.request(method="post", url="", json=params) # 内部自动序列化为JSON
cs = {'token': '12345', 'status': 'working'}
requests.request(method="get", url="", cookies=cs)
upload_files = {'file': open('report.xls', 'rb')}
requests.request(method="post", url="", files=upload_files)
proxies = {
  'http': 'http://10.100.57.47:8001',
  'https': 'http://10.100.57.47:8001',
}
requests.get('https://testerhome.com/', proxies=proxies)

(2)response 参数说明


↙↙↙阅读原文可查看相关链接,并与作者交流