http - -D- curl参数

标签 http curl parameters request

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/

相关文章:

curl - 如何知道主机是否支持 Range header ?

http - 我可以在完全读取 HTTP 请求之前发送 HTTP 响应吗?

javascript - Angular $http.get 报告 200(OK) 但响应永远不会改变

session - CURL 和浏览器的服务器行为不同

javascript - 我们可以在运行时更改 Protractor 配置文件中定义的参数值吗

带有 const 参数的 C++ 构造函数

PowerShell 函数 $ 输入参数

http - Chrome 或 FireFox 可以强制 https 请求而不是 http 请求吗?

Firebase Cloud Functions 使用 API key 保护 HTTPS 端点

maven - DataTorrent - 开发 Hello World 应用程序