连接https网站,加上-I选项,只打印响应Header,不打印响应body
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: Keep-Alive
Content-Length: 277
Content-Type: text/html
Date: Fri, 29 Mar 2019 02:43:25 GMT
Etag: "575e1f5c-115"
Last-Modified: Mon, 13 Jun 2016 02:50:04 GMT
Pragma: no-cache
Server: bfe/1.0.8.18
连接测试用的https网站,因为使用了自己签发的证书而报错
curl: ( 60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
加上-k选项,关闭对测试用https网站证书的验证
HTTP/1.1 200 OK
Date: Fri, 29 Mar 2019 02:44:50 GMT
Server: httpserver
X-Frame-Options: sameorigin
X-XSS-Protection: 1, mode= block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age= 30, includeSubDomains
Expect-CT: enforce, max-age= 86400
Last-Modified: Mon, 25 Mar 2019 06:12:51 GMT
ETag: "18-584e5182d0cc3"
Accept-Ranges: bytes
Content-Length: 24
Content-Type: text/html
去掉-I选项,不打印响应Header,打印响应body
index html 192.168.1.82
加上-i选项,打印响应Header和body
HTTP/1.1 200 OK
Date: Fri, 29 Mar 2019 02:54:29 GMT
Server: httpserver
X-Frame-Options: sameorigin
X-XSS-Protection: 1, mode= block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age= 30, includeSubDomains
Expect-CT: enforce, max-age= 86400
Last-Modified: Mon, 25 Mar 2019 06:19:58 GMT
ETag: "18-584e531a39358"
Accept-Ranges: bytes
Content-Length: 24
Content-Type: text/html
index html 192.168.1.83
加上–interface选项,指定本地IP地址
index html 192.168.1.83
加上-w选项,打印使用的本地IP地址及端口
index html 192.168.1.82
192.168.1.71:56802
加上–local-port选项,指定本地端口
index html 192.168.1.82
192.168.1.71:9999
使用–local-port选项,指定本地端口范围
index html 192.168.1.83
192.168.1.71:23
使用-g选项关闭通配符开关,以便访问IPv6网站
index html 192.168.1.83
2001:123::2:82:47258
使用-b选项,携带cookie参数
HTTP/1.1 200 OK
Date: Fri, 29 Mar 2019 03:06:42 GMT
Server: httpserver
X-Frame-Options: sameorigin
X-XSS-Protection: 1, mode= block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age= 30, includeSubDomains
Expect-CT: enforce, max-age= 86400
Last-Modified: Thu, 28 Mar 2019 03:32:48 GMT
ETag: "98972f-5851f35578f66"
Accept-Ranges: bytes
Content-Length: 10000175
Content-Type: text/html
测试负载均衡效果,响应Header中的Content-Length字段有不同
HTTP/1.1 200 OK
Date: Fri, 29 Mar 2019 03:06:46 GMT
Server: httpserver
X-Frame-Options: sameorigin
X-XSS-Protection: 1, mode= block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age= 30, includeSubDomains
Expect-CT: enforce, max-age= 86400
Last-Modified: Thu, 28 Mar 2019 02:17:12 GMT
ETag: "18-5851e26f62e27"
Accept-Ranges: bytes
Content-Length: 24
Content-Type: text/html
添加–http2选项,支持HTTP/2
HTTP/2 200
server: JSP3/2.0.14
date: Fri, 29 Mar 2019 06:53:49 GMT
content-type: text/css
content-length: 25542
etag: "5c7e1b2f-63c6"
last-modified: Tue, 05 Mar 2019 06:46:07 GMT
expires: Thu, 04 Apr 2019 10:51:09 GMT
age: 2059360
accept-ranges: bytes
cache-control: max-age= 2592000
vary: Accept-Encoding
ohc-response-time: 1 0 0 0 0 0