Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see the trailer headers with curl

In my response headers, I see Trailer: Content-MD5, Content-Sources. How can I look at this content with curl? I don't see this output when I use -i or -v.

like image 491
Redoubts Avatar asked Nov 17 '17 00:11

Redoubts


1 Answers

You can get Trailer's values if you provide --raw key along with -v to curl.

For example:

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
like image 116
Victor Perov Avatar answered Nov 01 '22 23:11

Victor Perov