作者:若涵她娘_124 | 来源:互联网 | 2022-12-11 10:08
我目前正在编写单元测试,以检查是否http/2
受支持。
是否有一个curl
单线可检查是否http/2
受支持并输出易于解析的响应?
1> Daniel Stenb..:
HTTP/2 supported:
$ curl -sI https://curl.haxx.se -o/dev/null -w '%{http_version}\n'
2
HTTP/2 not supported (instead serving 1.1 in this case):
$ curl -sI http://curl.haxx.se -o/dev/null -w '%{http_version}\n'
1.1
(curl 7.50.0 or later is required for this command line to work)