Skip to content
Myr

r.text

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent a89530a · Browse files · 1 file+4 added−4 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+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:docs/user/quickstart.rst+4 added-4 removed
86 unmodified lines
87dictionary of data will automatically be form-encoded when the request is made::8889 >>> payload = {'key1': 'value1', 'key2': 'value2'}90 >>> r = requests.post("http://httpbin.org/post", data=payload)91 >>> print r.content91 >>> print r.text92 {93 "origin": "179.13.100.4",94 "files": {},95 "form": {
46 unmodified lines
142 >>> url = 'http://httpbin.org/post'143 >>> files = {'report.xls': open('report.xls', 'rb')}144145 >>> r = requests.post(url, files=files)146 >>> r.content146 >>> r.text147 {148 "origin": "179.13.100.4",149 "files": {150 "report.xls": "<censored...binary...data>"
17 unmodified lines
168 >>> url = 'http://httpbin.org/post'169 >>> files = {'file': ('report.xls', open('report.xls', 'rb'))}170171 >>> r = requests.post(url, files=files)172 >>> r.content172 >>> r.text173 {174 "origin": "179.13.100.4",175 "files": {176 "file": "<censored...binary...data>"
101 unmodified lines
278 >>> url = 'http://httpbin.org/cookies'279 >>> cookies = dict(cookies_are='working')280281 >>> r = requests.get(url, cookies=cookies)282 >>> r.content282 >>> r.text283 '{"cookies": {"cookies_are": "working"}}'284285286Basic Authentication
113 unmodified lines