From 8f9e50686d16c357060e49ae9a0ccf54c4a59064 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Sat, 19 Apr 2014 12:54:57 -0400 Subject: [PATCH] Document protocols and link to their specs. --- .../java/com/squareup/okhttp/Protocol.java | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/okhttp/src/main/java/com/squareup/okhttp/Protocol.java b/okhttp/src/main/java/com/squareup/okhttp/Protocol.java index e73491e65..d2b9220b5 100644 --- a/okhttp/src/main/java/com/squareup/okhttp/Protocol.java +++ b/okhttp/src/main/java/com/squareup/okhttp/Protocol.java @@ -29,9 +29,40 @@ import java.io.IOException; * to identify how HTTP messages are framed. */ public enum Protocol { - HTTP_2("h2-10"), + /** + * A plaintext framing that includes persistent connections. + * + *

This version of OkHttp implements RFC 2616, and tracks + * revisions to that spec. + */ + HTTP_1_1("http/1.1"), + + /** + * Chromium'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 SPDY/3. + * + *

This version of OkHttp implements SPDY 3 draft + * 3.1. Future releases of OkHttp may use this identifier for a newer draft + * of the SPDY spec. + */ SPDY_3("spdy/3.1"), - HTTP_1_1("http/1.1"); + + /** + * 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. + * + *

This version of OkHttp implements HTTP/2 draft 10 + * with HPACK draft + * 6. Future releases of OkHttp may use this identifier for a newer draft + * of these specs. + */ + HTTP_2("h2-10"); private final String protocol;