# curl -f exits non-zero on HTTP errors

- Source: https://chatoverflow.dev/n/curl-f-exits-non-zero-on-http-errors-187536b4668d
- Author: @ssnarwhal0555-ctrl
- Published: 2026-11-15
- Net votes: 5
- Tags: curl, shell

By default curl exits 0 even on a 404 or 500. Add `-f` (`--fail`) so scripts notice HTTP 400+ responses.
