{"id":2875,"date":"2018-04-26T17:03:25","date_gmt":"2018-04-26T17:03:25","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2875"},"modified":"2020-07-21T12:27:36","modified_gmt":"2020-07-21T12:27:36","slug":"wget-general","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/command-line\/wget\/wget-general","title":{"rendered":".wget general"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Getting The Output Of A&nbsp;GET request On The Command Line<\/h4>\n\n\n\n<p>(You need to put the URL and parameters inside &#8220;&#8221; if using more than 1 parameter)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- \"somedomain.com\/somefile.php?SomeParameter1=abc&amp;SomeParameter2=23&amp;SomeParameter3=0\"<\/code><\/pre>\n\n\n\n<p>To show full connection information and errors too:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -O- \"somedomain.com\/somefile.php?SomeParameter1=abc&amp;SomeParameter2=23&amp;SomeParameter3=0\"<\/code><\/pre>\n\n\n\n<p>Options used:<\/p>\n\n\n\n<p>-q turns off the output of log, including error information.<br>-O -, equivlalent to -O \/dev\/stdout, means dump the web page to a file named \/dev\/stdout.<\/p>\n\n\n\n<p>( &#8220;-qO-&#8221; is same as using &#8220;wget -q -O &#8211; http:\/\/example.com&#8221; )<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Use a timeout!!!!<\/h4>\n\n\n\n<p>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<\/p>\n\n\n\n<p>&#8211;tries Number of retires, default 20.  Useful if downloading large files etc if connection requires reattempts to finish the download<\/p>\n\n\n\n<p>&#8211;timeout Timeout in seconds<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- --tries=1 --timeout=60 \"http:\\\\something\"<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">&#8211;tries and &#8211;timeout used together<\/h5>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/43662591\/wget-using-timeout-and-tries-together\/43664731\">https:\/\/stackoverflow.com\/questions\/43662591\/wget-using-timeout-and-tries-together\/43664731<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">wget documentation<\/h4>\n\n\n\n<p><a href=\"http:\/\/www.gnu.org\/software\/wget\/manual\/wget.html\">http:\/\/www.gnu.org\/software\/wget\/manual\/wget.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting The Output Of A&nbsp;GET request On The Command Line (You need to put the URL and parameters inside &#8220;&#8221; if using more than 1 parameter) To show full connection information and errors too: Options used: -q turns off the output of log, including error information.-O -, equivlalent to -O \/dev\/stdout, means dump the web [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144],"tags":[],"class_list":["post-2875","post","type-post","status-publish","format-standard","hentry","category-wget"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=2875"}],"version-history":[{"count":11,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2875\/revisions"}],"predecessor-version":[{"id":3272,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2875\/revisions\/3272"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}