curl-w32/docs/cmdline-opts/fail.md

856 B

c SPDX-License-Identifier Long Short Protocols Help Category Mutexed Added Multi See-also Example
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. curl fail f HTTP Fail fast with no output on HTTP errors important http fail-with-body 4.0 boolean
fail-with-body
fail-early
--fail $URL

--fail

Fail fast with no output at all on server errors. This is useful to enable scripts and users to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag prevents curl from outputting that and return error 22.

This method is not fail-safe and there are occasions where non-successful response codes slip through, especially when authentication is involved (response codes 401 and 407).