file uploads
authorKenneth Reitz <me@kennethreitz.com>
Sat, 12 Nov 2011 21:01:42 +0000 (13:01 -0800)
committerKenneth Reitz <me@kennethreitz.com>
Sat, 12 Nov 2011 21:01:42 +0000 (13:01 -0800)
docs/user/quickstart.rst

index 7148fe6a180143a2ce114c22c2668d3ebb7ca148..95add238bd16548f020692edf79321612639d1fb 100644 (file)
@@ -109,9 +109,26 @@ Requests makes it simple to upload Multipart-encoded files::
     >>> url = 'http://httpbin.org/post'
     >>> files = {'report.xls': open('report.xls', 'rb')}
 
-    >>> r = requests.post(url, data=None, files=files)
+    >>> r = requests.post(url, files=files)
     >>> r.content
-
+    {
+      "origin": "179.13.100.4",
+      "files": {
+        "hmm": "<censored...binary...data>"
+      },
+      "form": {},
+      "url": "http://httpbin.org/post",
+      "args": {},
+      "headers": {
+        "Content-Length": "3196",
+        "Accept-Encoding": "identity, deflate, compress, gzip",
+        "Accept": "*/*",
+        "User-Agent": "python-requests/0.8.0",
+        "Host": "httpbin.org:80",
+        "Content-Type": "multipart/form-data; boundary=127.0.0.1.502.21746.1321131593.786.1"
+      },
+      "data": ""
+    }