Getting The Output Of A GET request On The Command Line
(You need to put the URL and parameters inside “” if using more than 1 parameter)
wget -qO- "somedomain.com/somefile.php?SomeParameter1=abc&SomeParameter2=23&SomeParameter3=0"
To show full connection information and errors too:
wget -O- "somedomain.com/somefile.php?SomeParameter1=abc&SomeParameter2=23&SomeParameter3=0"
Options used:
-q turns off the output of log, including error information.
-O -, equivlalent to -O /dev/stdout, means dump the web page to a file named /dev/stdout.
( “-qO-” is same as using “wget -q -O – http://example.com” )
Use a timeout!!!!
The default wget timeout is 900 seconds. If you are using wget in an application and will retry then make sure you specify a timeout to avoid the possibility of multiple wgets being called on top of each other
–tries Number of retires, default 20. Useful if downloading large files etc if connection requires reattempts to finish the download
–timeout Timeout in seconds
wget -qO- --tries=1 --timeout=60 "http:\\something"
–tries and –timeout used together
https://stackoverflow.com/questions/43662591/wget-using-timeout-and-tries-together/43664731
wget documentation
http://www.gnu.org/software/wget/manual/wget.html