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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With