Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Re: [IDEA] --write-out print body on http error code
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Bastian Jesuiter via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 24 Jul 2024 10:00:26 +0200
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, <daniel_at_haxx.se> 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
>
Date: Wed, 24 Jul 2024 10:00:26 +0200
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, <daniel_at_haxx.se> 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.htmlReceived on 2024-07-24