Linux —— curl 查看请求头和响应头

curl -v http://www.mit.edu

* About to connect() to www.mit.edu port 80 (#0)
* Trying 184.27.21.169…
* Connected to www.mit.edu (184.27.21.169) port 80 (#0)

GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: www.mit.edu
Accept: */*

< HTTP/1.1 200 OK
< Server: Apache/1.3.41 (Unix) mod_ssl/2.8.31 OpenSSL/0.9.8j
< Last-Modified: Fri, 01 Apr 2016 04:01:07 GMT
< ETag: “10e86944-4966-56fdf283”
< Accept-Ranges: bytes
< Content-Length: 18790
< X-Cnection: close
< Content-Type: text/html
< Date: Fri, 01 Apr 2016 05:59:28 GMT
< Connection: keep-alive

curl http://www.baidu.com -I

HTTP/1.1 200 OK
Date: Fri, 01 Apr 2016 06:02:48 GMT
Content-Type: text/html; charset=utf-8
Connection: Keep-Alive
Vary: Accept-Encoding
Set-Cookie: BAIDUID=DCD2EA641568FA57197BC47CB9E0F4C8:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BIDUPSID=DCD2EA641568FA57197BC47CB9E0F4C8; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: PSTM=1459490568; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BDSVRTM=0; path=/
Set-Cookie: BD_HOME=0; path=/
Set-Cookie: H_PS_PSSID=18880_18286_1437_19555_19559_18560_17000_15271_11455_16915; path=/; domain=.baidu.com
P3P: CP=” OTI DSP COR IVA OUR IND COM ”
Cache-Control: private
Cxy_all: baidu+6106e55b79375facdeb88696aa847384
Expires: Fri, 01 Apr 2016 06:02:46 GMT
X-Powered-By: HPHP
Server: BWS/1.1
X-UA-Compatible: IE=Edge,chrome=1

首部各字段学习: http://tools.jb51.net/table/http_header

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值