fail-with-body.d 713 B

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