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: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Thu, 17 Mar 2022 23:26:52 +0100 (CET)

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.

> --output would put the html someplace else.

Sure, in a real-world use case you would.

> 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

> %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?

-- 
  / 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/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-03-17