mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
parent
881e9a616f
commit
5e2e470f20
@ -18,11 +18,17 @@ Example:
|
|||||||
|
|
||||||
# `--fail`
|
# `--fail`
|
||||||
|
|
||||||
Fail fast with no output at all on server errors. This is useful to enable
|
Fail with error code 22 and with no response body output at all for HTTP
|
||||||
scripts and users to better deal with failed attempts. In normal cases when an
|
transfers returning HTTP response codes at 400 or greater.
|
||||||
HTTP server fails to deliver a document, it returns an HTML document stating
|
|
||||||
so (which often also describes why and more). This command line option
|
In normal cases when an HTTP server fails to deliver a document, it returns a
|
||||||
prevents curl from outputting that and return error 22.
|
body of text stating so (which often also describes why and more) and a 4xx
|
||||||
|
HTTP response code. This command line option prevents curl from outputting
|
||||||
|
that data and instead returns error 22 early. By default, curl does not
|
||||||
|
consider HTTP response codes to indicate failure.
|
||||||
|
|
||||||
|
To get both the error code and also save the content, use --fail-with-body
|
||||||
|
instead.
|
||||||
|
|
||||||
This method is not fail-safe and there are occasions where non-successful
|
This method is not fail-safe and there are occasions where non-successful
|
||||||
response codes slip through, especially when authentication is involved
|
response codes slip through, especially when authentication is involved
|
||||||
|
Loading…
Reference in New Issue
Block a user