File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,17 @@ Example:
18
18
19
19
# ` --fail `
20
20
21
- Fail fast with no output at all on server errors. This is useful to enable
22
- scripts and users to better deal with failed attempts. In normal cases when an
23
- HTTP server fails to deliver a document, it returns an HTML document stating
24
- so (which often also describes why and more). This command line option
25
- prevents curl from outputting that and return error 22.
21
+ Fail with error code 22 and with no response body output at all for HTTP
22
+ transfers returning HTTP response codes at 400 or greater.
23
+
24
+ In normal cases when an HTTP server fails to deliver a document, it returns a
25
+ body of text stating so (which often also describes why and more) and a 4xx
26
+ HTTP response code. This command line option prevents curl from outputting
27
+ that data and instead returns error 22 early. By default, curl does not
28
+ consider HTTP response codes to indicate failure.
29
+
30
+ To get both the error code and also save the content, use --fail-with-body
31
+ instead.
26
32
27
33
This method is not fail-safe and there are occasions where non-successful
28
34
response codes slip through, especially when authentication is involved
You can’t perform that action at this time.
0 commit comments