enum class Protocol
Protocols that OkHttp implements for ALPN selection.
Despite its name, java.net.URL.getProtocol returns the scheme (http, https, etc.) of the URL, not the protocol (http/1.1, spdy/3.1, etc.). OkHttp uses the word protocol to identify how HTTP messages are framed.
|
An obsolete plaintext framing that does not use persistent sockets by default. |
|
|
A plaintext framing that includes persistent connections. |
|
|
The IETF's binary-framed protocol that includes header compression, multiplexing multiple requests on the same socket, and server-push. HTTP/1.1 semantics are layered on HTTP/2. |
|
|
Cleartext HTTP/2 with no "upgrade" round trip. This option requires the client to have prior knowledge that the server supports cleartext HTTP/2. |
|
|
QUIC (Quick UDP Internet Connection) is a new multiplexed and secure transport atop UDP, designed from the ground up and optimized for HTTP/2 semantics. HTTP/1.1 semantics are layered on HTTP/2. |
fun toString(): String
Returns the string used to identify this protocol for ALPN, like "http/1.1", "spdy/3.1" or "h2". |
fun get(protocol: String): Protocol
Returns the protocol identified by |