From: anentropic Date: Thu, 2 Aug 2012 11:56:12 +0000 (+0200) Subject: example looked wrong X-Git-Tag: v0.13.6~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdec88de995fd94c1f0dbe33e105680bbd1ac1de;p=services%2Fpython-requests.git example looked wrong From what I can tell from the source code (down thru urllib3) the key in the `files` dict is always the 'fieldname', while specifying a custom filename is optional. So in this example it is confusing to have a fieldname of 'report.xls' (the filename) where all the other examples use a fieldname of 'file'. --- diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index d3e786c..9b0399d 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -189,14 +189,14 @@ POST a Multipart-Encoded File Requests makes it simple to upload Multipart-encoded files:: >>> url = 'http://httpbin.org/post' - >>> files = {'report.xls': open('report.xls', 'rb')} + >>> files = {'file': open('report.xls', 'rb')} >>> r = requests.post(url, files=files) >>> r.text { // ...snip... // "files": { - "report.xls": "" + "file": "" }, // ...snip... // }