Skip to content
Myr

sending strings to be received as files

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

authored by barberj · committed by Shivaram Lingamneni · parent 3288426 · Browse files · 1 file+28 added−0 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+28 added−0 removed

  • other:+28 added−0 removed

1 file+28 added−0 removed

modified:docs/user/quickstart.rst+28 added
220 unmodified lines
221 },222 "data": ""223 }224225Sending strings to be received as files::226227 >>> url = 'http://httpbin.org/post'228 >>> files = {'file': ('report.csv', 'some,data,to,send\nanother,row,to,send\n')} 229230 >>> r = requests.post(url, files=files)231 >>> r.text232 {233 "origin": "179.13.100.4",234 "files": {235 "file": "some,data,to,send\\nanother,row,to,send\\n"236 },237 "form": {},238 "url": "http://httpbin.org/post",239 "args": {},240 "headers": {241 "Content-Length": "216",242 "Accept-Encoding": "identity, deflate, compress, gzip",243 "Connection": "keep-alive",244 "Accept": "*/*",245 "User-Agent": "python-requests/0.11.1",246 "Host": "httpbin.org", 247 "Content-Type": "multipart/form-data; boundary=127.0.0.1.502.41433.1335385481.788.1"248 }, 249 "json": null,250 "data": ""251 }252253254Response Status Codes255---------------------256257We can check the response status code::
203 unmodified lines