I read https://superuser.com/questions/272265/getting-curl-to-output-http-status-code . It mentioned that
curl -i
will print the HTTP response code. Is it possible to have curl print just the HTTP response code? Is there a generic way to get the HTTP status code for any type of request like GET/POST/etc?
I am using curl 7.54.0 on Mac OS High Sierra.
Thanks for reading.
This worked for me:
output:
200