curlでレスポンスヘッダー

表題をやる時のメモ。

■ 環境

  • curl

■ curl

ステータスコードとかのレスポンスヘッダーを見たいのだが、下記オプションで確認することができた。

$ curl --dump-header - http://www.google.co.jp/
HTTP/1.1 200 OK
Date: Thu, 13 Oct 2016 13:01:11 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=Shift_JIS
P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: NID=XXXXXXXXXXX; expires=Fri, 14-Apr-2017 13:01:11 GMT; path=/; domain=.google.co.jp; HttpOnly
Accept-Ranges: none
Vary: Accept-Encoding
Transfer-Encoding: chunked

<!doctype html><html itemscope="" itemtype="httpschema.org/WebPage" lang="ja">...

ひとつ賢くなった。

以上。