Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

command line curl with proxy and response status code

Tags:

curl

proxy

I am trying to get the response status code using command line CURL with proxy.

This returns the whole page, but I want just the status code. How do I do that? thank you.

curl -sL -w -x IP:PORT "%{http_code}\n" "http://www.example.com" -o /dev/null

like image 290
Nizzy Avatar asked May 30 '26 18:05

Nizzy


1 Answers

You were very close, the -w was just put in the wrong spot. Use it like this:

curl -sL -x IP:PORT -w '%{http_code}\n' "http://www.example.com" -o /dev/null
like image 181
Daniel Stenberg Avatar answered Jun 02 '26 20:06

Daniel Stenberg