Curl To Return Http Status Code Along With The Response

[Solved] Curl To Return Http Status Code Along With The Response | 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 : checking HTTP status responses with curl

Answered by : jason-m-potter

# Quick & Dirty HTTP Status Code Monitor
# First Set Your Domain
export domain=test123.com;
# Run the curl through awk and write to $domain.log then read back from the log
watch "curl -sIL https://$domain 2>&1 | awk '/HTTP/{print strftime(\"[ %F_%T ]\"),\$0}' >> $domain.log; tail -n30 $domain.log"
# You can use -n with watch to control frequency, default is 2 secondsd
Every 2.0s: curl -sIL https://test123.com 2>&1 | awk '/HTTP/{print strftime("[ %F_%T ]"),$0}' >> test123.com.... jpotter-wks: Tue Dec 13 18:01:43 2022
[ 2022-12-13_18:00:27 ] HTTP/2 200
[ 2022-12-13_18:00:30 ] HTTP/2 200
[ 2022-12-13_18:00:33 ] HTTP/2 200
[ 2022-12-13_18:00:35 ] HTTP/2 200
[ 2022-12-13_18:00:38 ] HTTP/2 200
[ 2022-12-13_18:00:40 ] HTTP/2 200
[ 2022-12-13_18:00:43 ] HTTP/2 200
[ 2022-12-13_18:00:46 ] HTTP/2 200

Source : | Last Update : Tue, 20 Dec 22

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 : get status code of curl

Answered by : disgusted-dragonfly-5sm1q2t23mto

curl -o /dev/null -s -w "%{http_code}\n" http://localhost

Source : | Last Update : Fri, 22 Jan 21

Question : getting only http code using curl

Answered by : sokserey-hing

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

Source : https://superuser.com/questions/272265/getting-curl-to-output-http-status-code | Last Update : Thu, 10 Nov 22

Answers related to curl to return http status code along with the response

Code Explorer Popular Question For Php