curl/docs/cmdline-opts/fail-with-body.md
Daniel Stenberg 2494b8dd51
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
   as the documentation is now markdown-looking.

 - made the parser treat 4-space indents as quotes

 - switch to building the curl.1 manpage using the "mainpage.idx" file,
   which lists the files to include to generate it, instead of using the
   previous page-footer/headers. Also, those files are now also .md
   ones, using the same format. I gave them underscore prefixes to make
   them sort separately:
   _NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
   _VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
   _OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
   _EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md

 - updated test cases accordingly

Closes #12751
2024-01-23 14:30:15 +01:00

769 B

c SPDX-License-Identifier Long Protocols Help Category Added Mutexed Multi See-also Example
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. curl fail-with-body HTTP Fail on HTTP errors but save the body http output 7.76.0 fail boolean
fail
fail-early
--fail-with-body $URL

--fail-with-body

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 returns an HTML document stating so (which often also describes why and more). This flag allows curl to output and save that content but also to return error 22.

This is an alternative option to --fail which makes curl fail for the same circumstances but without saving the content.