fail-with-body.d 727 B

12345678910111213141516171819
  1. c: Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, 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. Mutexed: fail
  10. Example: --fail-with-body $URL
  11. ---
  12. Return an error on server errors where the HTTP response code is 400 or
  13. greater). In normal cases when an HTTP server fails to deliver a document, it
  14. returns an HTML document stating so (which often also describes why and
  15. more). This flag will still allow curl to output and save that content but
  16. also to return error 22.
  17. This is an alternative option to --fail which makes curl fail for the same
  18. circumstances but without saving the content.