diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-11-12 10:32:47 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-11-12 10:32:47 (GMT) |
commit | 040a927cd14e799454b246dd1f56fd7f4fdff03a (patch) | |
tree | 1d7e405492eecb89f90faf3751ee0368a81f2a56 /Doc | |
parent | 1ee79f16e859fd0a6ea3af64a539b5198b8ab7a3 (diff) | |
download | cpython-040a927cd14e799454b246dd1f56fd7f4fdff03a.zip cpython-040a927cd14e799454b246dd1f56fd7f4fdff03a.tar.gz cpython-040a927cd14e799454b246dd1f56fd7f4fdff03a.tar.bz2 |
Patch #1065257: Support passing open files as body in
HTTPConnection.request().
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libhttplib.tex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/lib/libhttplib.tex b/Doc/lib/libhttplib.tex index 049f6c4..557ee3d 100644 --- a/Doc/lib/libhttplib.tex +++ b/Doc/lib/libhttplib.tex @@ -304,9 +304,14 @@ Example: \code{httplib.responses[httplib.NOT_FOUND]} is \code{'Not Found'}. This will send a request to the server using the HTTP request method \var{method} and the selector \var{url}. If the \var{body} argument is present, it should be a string of data to send after the headers are finished. +Alternatively, it may be an open file object, in which case the +contents of the file is sent; this file object should support +\code{fileno()} and \code{read()} methods. The header Content-Length is automatically set to the correct value. The \var{headers} argument should be a mapping of extra HTTP headers to send with the request. + +\versionchanged[\var{body} can be a file object]{2.6} \end{methoddesc} \begin{methoddesc}{getresponse}{} |