Curl Get Return Code

[Solved] Curl Get Return Code | Php - Code Explorer | yomemimo.com
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 example

Answered by : yucky-yak-ecsdj7sqtmzw

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/resource

Source : https://stackoverflow.com/questions/14978411/http-post-and-get-using-curl-in-linux | Last Update : Wed, 08 Jul 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

Answers related to curl get return code

Code Explorer Popular Question For Php