mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
further cleanup examples
This commit is contained in:
+14
-13
@@ -124,23 +124,24 @@ applied, replace the call to ``Request.prepare()`` with a call to
|
||||
from requests import Request, Session
|
||||
|
||||
s = Session()
|
||||
req = Request('GET', # or any other method, 'POST', 'PUT', etc.
|
||||
url,
|
||||
data=data
|
||||
headers=headers
|
||||
# ...
|
||||
)
|
||||
req = Request('GET', url,
|
||||
data=data
|
||||
headers=headers
|
||||
)
|
||||
|
||||
prepped = s.prepare_request(req)
|
||||
|
||||
# do something with prepped.body
|
||||
# do something with prepped.headers
|
||||
|
||||
resp = s.send(prepped,
|
||||
stream=stream,
|
||||
verify=verify,
|
||||
proxies=proxies,
|
||||
cert=cert,
|
||||
timeout=timeout,
|
||||
# etc.
|
||||
)
|
||||
stream=stream,
|
||||
verify=verify,
|
||||
proxies=proxies,
|
||||
cert=cert,
|
||||
timeout=timeout
|
||||
)
|
||||
|
||||
print(resp.status_code)
|
||||
|
||||
SSL Cert Verification
|
||||
|
||||
Reference in New Issue
Block a user