According to the documentation,
k6 will use HTTP/1.1 by default when it contacts a server. If, after connection, the server reports to k6 that it supports HTTP/2, k6 will upgrade the connection to HTTP/2 instead. This is all automatic…
However, I saw by the --http-debug option that k6 still uses HTTP/1.1 requests after connection. Is this a bug in k6, in the output of the --http-debug option or is there a way to configure?
k6 server HTTP/1.1 --> <-- HTTP/2 server reports to k6 that it supports HTTP/2 (by ALPN Extention and with response) HTTP/1.1 --> <-- HTTP/2 HTTP/1.1 --> <-- HTTP/2
It would be also great if we would have an option like “–http2-prior-knowledge” in the curl command to let k6 use HTTP/2 when it contacts a server.