Skip to content
Myr

fix @lukasa's lack of taste :)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

#1702

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 25f86f1 · Browse files · 1 file+14 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−13 removed

  • other:+14 added−13 removed

1 file+14 added−13 removed

modified:docs/user/advanced.rst+14 added-13 removed
87 unmodified lines
8889 from requests import Request, Session9091 s = Session()92 prepped = Request('GET', # or any other method, 'POST', 'PUT', etc.93 url,94 data=data95 headers=headers96 # ...97 ).prepare()92 req = Request('GET', url,93 data=data,94 headers=header95 )96 prepped = req.prepare()9798 # do something with prepped.body99 # do something with prepped.headers100101 resp = s.send(prepped,101 stream=stream,102 verify=verify,103 proxies=proxies,104 cert=cert,105 timeout=timeout,106 # etc.107 )102 stream=stream,103 verify=verify,104 proxies=proxies,105 cert=cert,106 timeout=timeout107 )108109 print(resp.status_code)110111Since you are not doing anything special with the ``Request`` object, you112prepare it immediately and modified the ``PreparedRequest`` object. You then
485 unmodified lines