· ☕ 6 分钟
Negotiation HTTP 1.1 plain text Upgrade header https://http2-explained.haxx.se/en/part5#5.1.-http2-for-existing-uri-schemes
As mentioned already, the existing URI schemes cannot be modified, so http2 must use the existing ones. Since they are used for HTTP 1.x today, we obviously need a way to upgrade the protocol to http2, or otherwise ask the server to use http2 instead of older protocols.
HTTP 1.1 has a defined way to do this, namely the Upgrade: header, which allows the server to send back a response using the new protocol when getting such a request over the old protocol, at the cost of an additional round-trip.