Question : curl return code only
Answered by : tough-tuatara-jzlzsms54ht7
curl -s -o /dev/null -w "%{http_code}" http://www.example.org/
Source : https://superuser.com/questions/272265/getting-curl-to-output-http-status-code | Last Update : Sat, 08 Aug 20
Question : curl get return code
Answered by : uptight-unicorn-rtu7lrf8814i
curl -I http://www.example.org
Source : https://superuser.com/questions/272265/getting-curl-to-output-http-status-code | Last Update : Thu, 25 Mar 21
Question : Capture url response status code with curl
Answered by : viranson-hounnouvi
STATUS_CODE=$(curl \ --output /dev/null \ --silent \ --write-out "%{http_code}" \ "https://alexwlchan.net")
if (( STATUS_CODE == 200 ))
then echo "Website is up!"
else echo "Website is down! Expected 200, got $STATUS_CODE"
fi
Source : https://alexwlchan.net/2022/04/checking-with-curl/ | Last Update : Mon, 22 Aug 22
Question : test url response code with curl
Answered by : viranson-hounnouvi
curl \ --output /dev/null \ --silent \ --write-out "%{http_code}" \ "https://alexwlchan.net"
Source : https://alexwlchan.net/2022/04/checking-with-curl/ | Last Update : Mon, 22 Aug 22