1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Clarify operation of --post-file.

This commit is contained in:
Micah Cowan 2009-07-06 23:12:06 -07:00
parent 532aa2cb2d
commit 0b4470b5e7
2 changed files with 15 additions and 4 deletions

View File

@ -4,6 +4,7 @@
--input-file, implying that --force-html isn't necessary when the --input-file, implying that --force-html isn't necessary when the
input is in HTML file. Improve accuracy of --base description. input is in HTML file. Improve accuracy of --base description.
(Wgetrc Commands): Improve accuracy of "base" description. (Wgetrc Commands): Improve accuracy of "base" description.
(HTTP Options): Clarify operation of --post-file.
2009-07-03 Micah Cowan <micah@cowan.name> 2009-07-03 Micah Cowan <micah@cowan.name>

View File

@ -1394,10 +1394,20 @@ not to send the @code{User-Agent} header in @sc{http} requests.
@cindex POST @cindex POST
@item --post-data=@var{string} @item --post-data=@var{string}
@itemx --post-file=@var{file} @itemx --post-file=@var{file}
Use POST as the method for all HTTP requests and send the specified data Use POST as the method for all HTTP requests and send the specified
in the request body. @code{--post-data} sends @var{string} as data, data in the request body. @samp{--post-data} sends @var{string} as
whereas @code{--post-file} sends the contents of @var{file}. Other than data, whereas @samp{--post-file} sends the contents of @var{file}.
that, they work in exactly the same way. Other than that, they work in exactly the same way. In particular,
they @emph{both} expect content of the form @code{key1=value1&key2=value2},
with percent-encoding for special characters; the only difference is
that one expects its content as a command-line paramter and the other
accepts its content from a file. In particular, @samp{--post-file} is
@emph{not} for transmitting files as form attachments: those must
appear as @code{key=value} data (with appropriate percent-coding) just
like everything else. Wget does not currently support
@code{multipart/form-data} for transmitting POST data; only
@code{application/x-www-form-urlencoded}. Only one of
@samp{--post-data} and @samp{--post-file} should be specified.
Please be aware that Wget needs to know the size of the POST data in Please be aware that Wget needs to know the size of the POST data in
advance. Therefore the argument to @code{--post-file} must be a regular advance. Therefore the argument to @code{--post-file} must be a regular