Intro
測試方法
首先可以檢查CURL是否支援HTTP2
:
$ curl --version
...
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy
CURL --http2
利用CURL的--http2
參數指定開啟HTTP/2
並用的-I
參數回傳Header確認Protocol:
$ curl --http2 -I https://www.google.com
HTTP/2 200
content-type: text/html; charset=ISO-8859-1
...