Re: [IDEA] --write-out print body on http error code

Bastian Jesuiter via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <CAL07qPUfWeN1gwLY93UjLFqk0qsJ20_WH6YHN__Xv30PS5bQ2A@mail.gmail.com>
Kind of,

--Fail-with-body will also print the error into the file, but not display
it in stdout if --out-file (-o) is specified.
So the idea is to basically only write into file if status code is okay (or
similar ) but error into stdout when there is one. (So that it may
potentially be included into logs)

On Wed, 24 Jul 2024, 09:34 Daniel Stenberg, <[email protected]> wrote:

> On Wed, 24 Jul 2024, Bastian Jesuiter via curl-users wrote:
>
> > But if --fail is used, no body is printed into neither the file nor
> stdout.
> > In a lot of cases, servers (like Artifactory) usually respond with some
> > kind of error message in the return, which may be helpful to know to the
> > person using the command.
>
> Are you asking for --fail-with-body ?
>
>    https://curl.se/docs/manpage.html#--fail-with-body
>
> --
>
>   / daniel.haxx.se
>   | Commercial curl support up to 24x7 is available!
>   | Private help, bug fixes, support, ports, new features
>   | https://curl.se/support.html
>

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.