curl - 我如何看到带有 curl 的预告片标题

标签 curl http-headers

在我的响应头中,我看到 Trailer: Content-MD5, Content-Sources .如何使用 curl 查看此内容?我在使用 -i 时没有看到这个输出或 -v .

最佳答案

如果您提供 --raw,您可以获得 Trailer 的值。 key 和 -v curl 。

例如:

curl http://localhost:3030/graphql -H 'Content-Type: application/json' --data '{"query": "..."}' -v --raw

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3030 (#0)
> POST /graphql HTTP/1.1
> Host: localhost:3030
> User-Agent: curl/7.58.0
> Accept: */*
> Referer: rbose
> Debug-Request: true
> Content-Type: application/json
> Content-Length: 429
>
* upload completely sent off: 429 out of 429 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Trailer: Debug-Request-Time
< Trailer: Debug-Query-Time
< Date: Wed, 20 Feb 2019 12:42:16 GMT
< Transfer-Encoding: chunked
<
43
{"data":{...}}
0
Debug-Query-Time: 288.903µs
Debug-Request-Time: 477.616264ms

关于curl - 我如何看到带有 curl 的预告片标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47341216/

相关文章:

php - 通过 PHP/Curl 使用 CloudFlare API 返回错误

powershell - curl 的Invoke-RestMethod或Invoke-WebRequest版本?

security - 使用具有相同值的重复响应 header 可以吗?

javascript - 保持 WebSocket 连接有效

laravel - 未为某些 Laravel 路由设置 .htaccess X-Frame-Options header

c# - HttpModule 向请求添加 header

php - 调用未定义的未定义函数?

python - 如何将curl转换为python请求

php - 视频主机链接损坏检查

android - 如何获取默认内容类型 Android Volley