2016-11-16 06:44:58 +08:00
|
|
|
Long: fail
|
|
|
|
Short: f
|
|
|
|
Protocols: HTTP
|
|
|
|
Help: Fail silently (no output at all) on HTTP errors
|
2021-02-11 15:30:39 +08:00
|
|
|
See-also: fail-with-body
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: important http
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: --fail $URL
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 4.0
|
2016-11-16 06:44:58 +08:00
|
|
|
---
|
|
|
|
Fail silently (no output at all) on server errors. This is mostly done to
|
2020-12-29 17:44:35 +08:00
|
|
|
enable scripts etc to better deal with failed attempts. In normal cases
|
2016-11-16 06:44:58 +08:00
|
|
|
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 will prevent
|
|
|
|
curl from outputting that and return error 22.
|
|
|
|
|
|
|
|
This method is not fail-safe and there are occasions where non-successful
|
|
|
|
response codes will slip through, especially when authentication is involved
|
|
|
|
(response codes 401 and 407).
|