curl usage to get header

后端 未结 3 1079
无人共我
无人共我 2021-01-30 20:12

Why does this not work:

curl -X HEAD http://www.google.com

But these both work just fine:

curl -I http://www.google.com

curl -         


        
3条回答
  •  隐瞒了意图╮
    2021-01-30 20:54

    curl --head https://www.example.net

    I was pointed to this by curl itself; when I issued the command with -X HEAD, it printed:

    Warning: Setting custom HTTP method to HEAD with -X/--request may not work the 
    Warning: way you want. Consider using -I/--head instead.
    

提交回复
热议问题