卷曲-D-选项

时间:2014-07-29 14:10:34

标签: bash curl

我正在阅读JIRA REST API教程,在他们的示例curl请求中,他们显示

curl -D- -u username:password <rest-of-request>

使用破折号之前和之后的-D-语法是什么?

1 个答案:

答案 0 :(得分:3)

引用man curl

  -D, --dump-header <file>
          Write the protocol headers to the specified file.

          This  option is handy to use when you want to store
          the headers that a HTTP site sends to you. C

-D之后,您通常会提供要转储标头的文件的名称。与许多实用程序一样,-被识别为an alias to stdout
(如果您不熟悉这个概念:当您从没有重定向的终端启动命令时, stdout 是“终端屏幕”)

-D-(不含空格)表单与-D -完全相同(或至少在Linux上-D /dev/stdout

相关问题