Jira API doc中有一个示例:
curl -D- -X GET -H "Authorization: Basic ZnJlZDpmcmVk" -H "Content-Type: application/json" "http://kelpie9:8081/rest/api/2/issue/QA-31"
-D-
参数到底是什么意思? curl documentation中没有描述.
我也不确定 -D-
和 -D
是不是同一个意思。
最佳答案
它将 header 转储到标准输出。
-D 标志将 header 转储到文件中,接下来的 - 指示它转储到标准输出。来自链接规范:
-D, --dump-header
Write the protocol headers to the specified file.
它没有为此选项指定,但这与其他采用文件名的选项一样工作:
Use "-" as filename to have the output sent to stdout.
关于http - -D- curl参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39293348/