further cleanup examples

This commit is contained in:
Kenneth Reitz
2013-10-28 13:39:04 -04:00
parent a9839dc7db
commit ebdd5cabab
+14 -13
View File
@@ -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