how to get status code in curl request code example Example: get status code of curl curl -o /dev/null -s -w "%{http_code}\n" http://localhost