From 1e3eb4ef9e21dded404909142b92fd7506b701f2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 28 Jan 2014 12:03:59 +0300 Subject: [PATCH] Added info about posted files headers --- docs/user/quickstart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 3e802e19..f4273610 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -234,10 +234,10 @@ Requests makes it simple to upload Multipart-encoded files:: ... } -You can set the filename explicitly:: +You can set the filename, content_type and headers explicitly: >>> url = 'http://httpbin.org/post' - >>> files = {'file': ('report.xls', open('report.xls', 'rb'))} + >>> files = {'file': ('report.xls', open('report.xls', 'rb'), 'application/vnd.ms-excel', {'Expires': '0'})} >>> r = requests.post(url, files=files) >>> r.text