blob: adf5294f44f06d9c1952673ed0848f5506caff76 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
2SPDX-License-Identifier: curl
3Long: fail-with-body
4Protocols: HTTP
5Help: Fail on HTTP errors but save the body
6Category: http output
7Added: 7.76.0
8See-also: fail
9Mutexed: fail
10Example: --fail-with-body $URL
11Multi: boolean
12---
13Return an error on server errors where the HTTP response code is 400 or
14greater). In normal cases when an HTTP server fails to deliver a document, it
15returns an HTML document stating so (which often also describes why and
16more). This flag will still allow curl to output and save that content but
17also to return error 22.
18
19This is an alternative option to --fail which makes curl fail for the same
20circumstances but without saving the content.