fail-with-body.d 742 B

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