Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
man wget
--post-data=string
--post-file=file
Use POST as the method for all HTTP requests and send the specified
data in the request body. "--post-data" sends string as data,
whereas "--post-file" sends the contents of file. Other than that,
they work in exactly the same way.
Please be aware that Wget needs to know the size of the POST data
in advance. Therefore the argument to "--post-file" must be a reg-
ular file; specifying a FIFO or something like /dev/stdin won't
work. It's not quite clear how to work around this limitation
inherent in HTTP/1.0. Although HTTP/1.1 introduces chunked trans-
fer that doesn't require knowing the request length in advance, a
client can't use chunked unless it knows it's talking to an
HTTP/1.1 server. And it can't know that until it receives a
response, which in turn requires the request to have been completed
-- a chicken-and-egg problem.
Note: if Wget is redirected after the POST request is completed, it
will not send the POST data to the redirected URL. This is because
URLs that process POST often respond with a redirection to a regu-
lar page, which does not desire or accept POST. It is not com-
pletely clear that this behavior is optimal; if it doesn't work
out, it might be changed in the future.
This example shows how to log to a server using POST and then pro-
ceed to download the desired pages, presumably only accessible to
authorized users:
# Log in to the server. This can be done only once.
wget --save-cookies cookies.txt \
--post-data 'user=foo&password=bar' \
http://server.com/auth.php
# Now grab the page or pages we care about.
wget --load-cookies cookies.txt \
-p http://server.com/interesting/article.php
If the server is using session cookies to track user authentica-
tion, the above will not work because --save-cookies will not save
them (and neither will browsers) and the cookies.txt file will be
empty. In that case use --keep-session-cookies along with
--save-cookies to force saving of session cookies.