2023-01-02 20:51:48 +08:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2021-02-11 15:30:39 +08:00
|
|
|
Long: fail-with-body
|
|
|
|
Protocols: HTTP
|
|
|
|
Help: Fail on HTTP errors but save the body
|
|
|
|
Category: http output
|
|
|
|
Added: 7.76.0
|
|
|
|
See-also: fail
|
2022-07-29 03:02:45 +08:00
|
|
|
Mutexed: fail
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: --fail-with-body $URL
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: boolean
|
2021-02-11 15:30:39 +08:00
|
|
|
---
|
|
|
|
Return an error on server errors where the HTTP response code is 400 or
|
|
|
|
greater). 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
|
2021-04-27 23:53:39 +08:00
|
|
|
more). This flag will still allow curl to output and save that content but
|
2021-02-11 15:30:39 +08:00
|
|
|
also to return error 22.
|
|
|
|
|
|
|
|
This is an alternative option to --fail which makes curl fail for the same
|
|
|
|
circumstances but without saving the content.
|