From 0b4470b5e79248529f8fac79140f1e00ba3b9b43 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Mon, 6 Jul 2009 23:12:06 -0700 Subject: [PATCH] Clarify operation of --post-file. --- doc/ChangeLog | 1 + doc/wget.texi | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 92866ad8..862ed129 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,6 +4,7 @@ --input-file, implying that --force-html isn't necessary when the input is in HTML file. Improve accuracy of --base description. (Wgetrc Commands): Improve accuracy of "base" description. + (HTTP Options): Clarify operation of --post-file. 2009-07-03 Micah Cowan diff --git a/doc/wget.texi b/doc/wget.texi index 60634f15..f040e8dc 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -1394,10 +1394,20 @@ not to send the @code{User-Agent} header in @sc{http} requests. @cindex POST @item --post-data=@var{string} @itemx --post-file=@var{file} -Use POST as the method for all HTTP requests and send the specified data -in the request body. @code{--post-data} sends @var{string} as data, -whereas @code{--post-file} sends the contents of @var{file}. Other than -that, they work in exactly the same way. +Use POST as the method for all HTTP requests and send the specified +data in the request body. @samp{--post-data} sends @var{string} as +data, whereas @samp{--post-file} sends the contents of @var{file}. +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 advance. Therefore the argument to @code{--post-file} must be a regular -- 2.39.2