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: -I Flag

From: Dan Fandrich via curl-users <curl-users_at_lists.haxx.se>
Date: Tue, 12 Jul 2022 20:56:24 -0700

On Wed, Jul 13, 2022 at 11:01:42AM +0800, Keefe Tang via curl-users wrote:
> I understand when you run curl with the -I flag (or --head) the
> request method is HEAD.
>
> If I combine my command with "-X GET", will the request method be
> overridden to GET instead?
>
> Is there any downside to doing this that I may not be considering?

A HEAD request does not send a body, whereas GET does. If you override a HEAD
request with GET, then curl won't expect a body but the server will send one,
which will set curl out of sync with the server.

Dan
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-07-13