如何通过 curl 查看 HTTP 请求标头?

P K*_*P K 8 linux http curl

我可以通过curl -I命令查看 HTTP 标头响应。

是否有任何选项可以查看发送的 HTTP 请求标头?

curl -I www.google.com

HTTP/1.1 200 OK
Date: Sat, 31 Dec 2011 00:55:53 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Server: gws
Transfer-Encoding: chunked
Run Code Online (Sandbox Code Playgroud)

小智 9

curl手册页:

   -v/--verbose
          Makes the fetching more verbose/talkative. Mostly useful for debugging. A line  starting
          with '>' means "header data" sent by curl, '<' means "header data" received by curl that
          is hidden in normal cases, and a line starting with '*' means additional  info  provided
          by curl.
Run Code Online (Sandbox Code Playgroud)