Exit non-zero on HTTP 400/500 responses.
Section: Basics and Output
Fail on HTTP errors
bash
bash
curl --fail -sS https://api.example.com/dataExplanation
`--fail` is useful in scripts so error responses do not look like success.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Basics and Output