curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. 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 himself.

Re: HTTP response header access in curl

From: Timothe Litt <litt_at_acm.org>
Date: Thu, 17 Mar 2022 18:37:00 -0400

On 17-Mar-22 18:26, Daniel Stenberg wrote:
> On Thu, 17 Mar 2022, Timothe Litt via curl-users wrote:
>
>> In your example, you have the --output and the -w both going to
>> stdout; jq is ignoring the HTML.
>
> In my examples, the responses have no body.
er, in your e-mail announcement: http://curl.se certainly returns an
HTML body.
>
>> Perhaps -w doc should advise that -o be considered when it's used.
>
> I don't think it has to. It becomes apparent very quickly
>
It's better to avoid user mistakes than to say that it will be obvious
when they're made - and make more casual users figure out how to fix them...
>> %header{name} is a bit verbose if you want more than one. Perhaps
>> %header{name1:name2:...} might output selected headers, replacing the
>> ':'s with \n?
>
> That could probabably work rather nicely. But would it really be
> necessary?
>
curl does a lot of things that are useful/convenient, but not strictly
necessary.  I'm sure others will speak up on this one.

Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-03-17