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: "--head" and "--request" Options Together
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Daniel Stenberg via curl-users <curl-users_at_cool.haxx.se>
Date: Tue, 9 Mar 2021 23:15:17 +0100 (CET)
On Tue, 9 Mar 2021, Thuc Nguyen via curl-users wrote:
> What's the expected behavior when both "--head" and "--request GET" options
> are provided?
Mostly sadness and confused users. I once wrote a blog post on this topic:
https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/
--head means that curl will send a HEAD and *not* wait for a response body,
because HEAD responses have no bodies.
When you add --request to the equation, curl will still *think* it makes a
HEAD but you change the actual method verb to "GET" and thus the server will
respood with a response body, but curl will not read it because it still knows
you're doing a HEAD.
> I'm able to reproduce with the latest version 7.75.0. I happen to have an
> older version, 7.29.0, and can't reproduce it there. So it seems that the
> behavior was changed in recent versions.
What behavior were you hoping for?
Date: Tue, 9 Mar 2021 23:15:17 +0100 (CET)
On Tue, 9 Mar 2021, Thuc Nguyen via curl-users wrote:
> What's the expected behavior when both "--head" and "--request GET" options
> are provided?
Mostly sadness and confused users. I once wrote a blog post on this topic:
https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/
--head means that curl will send a HEAD and *not* wait for a response body,
because HEAD responses have no bodies.
When you add --request to the equation, curl will still *think* it makes a
HEAD but you change the actual method verb to "GET" and thus the server will
respood with a response body, but curl will not read it because it still knows
you're doing a HEAD.
> I'm able to reproduce with the latest version 7.75.0. I happen to have an
> older version, 7.29.0, and can't reproduce it there. So it seems that the
> behavior was changed in recent versions.
What behavior were you hoping for?
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://www.wolfssl.com/contact/ ----------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2021-03-09