master-server/deps/curl/docs/cmdline-opts/fail-with-body.md

28 lines
771 B
Markdown
Raw Normal View History

2024-05-15 15:20:32 -04:00
---
2023-12-11 20:30:44 -05:00
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: fail-with-body
Protocols: HTTP
Help: Fail on HTTP errors but save the body
Category: http output
Added: 7.76.0
Mutexed: fail
Multi: boolean
2024-05-15 15:20:32 -04:00
See-also:
- fail
- fail-early
Example:
- --fail-with-body $URL
2023-12-11 20:30:44 -05:00
---
2024-05-15 15:20:32 -04:00
# `--fail-with-body`
2023-12-11 20:30:44 -05: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
2024-05-15 15:20:32 -04:00
returns an HTML document stating so (which often also describes why and more).
This option allows curl to output and save that content but also to return
error 22.
2023-12-11 20:30:44 -05:00
This is an alternative option to --fail which makes curl fail for the same
circumstances but without saving the content.