Share
Embed
Death, Taxes, and HTTP (Chicago Roboto 2017 Keynote)
‘Tis impossible to be sure of anything but death, taxes, and HTTP. This talk will explore some of the overhead inherent to HTTP and how it can be optimized or eliminated for more efficient networking.
Video: https://youtu.be/6uroXz5l7Gk?t=357
Jake Wharton PRO
April 20, 2017
Transcript
207 slides
-
Client Server TLS v1.2 w/ session resumption GET / HTTP/1.1
HTTP/1.1 200 OK -
GET / HTTP/1.1 HTTP/1.1 200 OK Client Server TLS v1.2
w/ session resumption -
Client Server TLS v1.2 w/ session resumption 3 GET /
HTTP/1.1 HTTP/1.1 200 OK -
Client Server TLS v1.3 w/ session resumption GET / HTTP/1.1
HTTP/1.1 200 OK -
Client Server TLS v1.3 w/ 0-RTT session resumption GET /
HTTP/1.1 HTTP/1.1 200 OK -
Client Server TLS v1.3 w/ 0-RTT session resumption GET /
HTTP/1.1 HTTP/1.1 200 OK -
Client Server TLS v1.3 w/ 0-RTT session resumption GET /
HTTP/1.1 HTTP/1.1 200 OK -
RTT TLS v1.3 w/ 0-RTT session resumption TLS v1.3 w/
session resumption TLS v1.3 TLS v1.2 w/ session resumption TLS v1.2 2 1 1 1 0 -
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()
.url("https://twitter.com") .build(); Call call = client.newCall(request); Response response = call.execute(); System.out.println(response.handshake().tlsVersion()); -
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()
.url("https://twitter.com") .build(); Call call = client.newCall(request); Response response = call.execute(); System.out.println(response.handshake().tlsVersion()); -
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()
.url("https://twitter.com") .build(); Call call = client.newCall(request); Response response = call.execute(); System.out.println(response.handshake().tlsVersion()); TLS_1_2 -
GET /YHTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic
QWxhZGRpbjpPcGVuU2VzYW1l HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} HTTP -
/Y /payments.html /profile.html /login.html /settings.html /static/fonts/roboto.ttf /static/js/app.js /static/css/main.css /static/image/logo.png /api/auth
/api/user /api/payments /api/payments/1234 /api/settings -
.js .html .js .js .js .js .js .js .png .png
.png .png .png .png .png .png .css .css .css .css -
.js .html .js .js .js .js .js .js .png .jpg
.png .png .jpg .png .png .png .png .png .css .css .css .css -
.js .html .js .js .js .js .js .js .png .jpg
.png .png .jpg .png .png .png .png .png .css .css .css .css 22 requests -
.js .html .js .js .js .js .js .js .png .jpg
.png .png .jpg .png .png .png .png .png .css .css .css .css 16 requests -
.js .html .png .jpg .png .png .jpg .png .png .png
.png .png .css .css .css .css 13 requests -
.js .html .png .jpg .png .png .jpg .png .css 6
requests .png .png .png .png -
.js .html .png .jpg .png .png .jpg .png .css 6
requests .png .png .png .png -
.js .html .jpg .jpg .png .css 1+3+2 requests example.com cdn.example.com
images.example.com -
.js .html .jpg .jpg .png .css example.com cdn.example.com images.example.com .jpg
.jpg .jpg .jpg .jpg .jpg -
.js .html .png .css example.com cdn.example.com images.example.com .jpg .jpg .jpg
.jpg .jpg .jpg .jpg .jpg -
.js .html .png .css example.com cdn.example.com images1.example.com .jpg .jpg .jpg
.jpg .jpg .jpg .jpg .jpg images2.example.com -
.js .html .png .css example.com cdn.example.com images1.example.com .jpg .jpg .jpg
.jpg .jpg .jpg .jpg .jpg images2.example.com -
/api/payments [A 1234, 1275, 1690, 2641, 2903, 4991, 5312, 5319,
14328, 28321, 29948, 30991, 37174, 73572 ]B -
/api/payments [A 1234, 1275, 1690, 2641, 2903, 4991, 5312, 5319,
14328, 28321, 29948, 30991, 37174, 73572 ]B /api/payments/{id} {C id: 1234, amount: 4200, currency: "USD", initiator_id:F48818374, recipient_id:G24567654, initiated_at: 14764993868, completed_at: 14769455213 },Z -
/api/payments [A {C id: 1234, amount: 4200, currency: "USD", initiator:F{
id: 48818374, name: "Jake Wharton" }, recipient:G{ id: 24567654, name: "Jesse Wilson" }, initiated_at: 14764993868, completed_at: 14769455213 },Z ... /api/payments/{id} 1234 1275 1690, 2641, 2903, 4991, 5312, 5319, 14328, -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} HTTP/1.1 HTTP/2 GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} HTTP/1.1 HTTP/2 GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} ID: 2 ID: 2 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} ID: 2 ID: 2 GET /api/payments HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} ID: 2 ID: 2 GET /api/payments HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} ID: 2 ID: 2 GET /api/payments HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT {"id":1234,"amount":4200,"currency":"USD"} ID: 2 ID: 2 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 {"id":1234,"amount":4200,"currency":"USD"} ID: 2 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 {"id":1234,"amount":420 ID: 2 [1234,1275,1690,2641,2903,49 ID: 4 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 Host: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: square.com:443 User-Agent: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 Accept: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 Accept: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json Authorization:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK Content-Type: application/json Content-Length: 42 E-Tag: "686897696a7c876b7e" Last-Modified: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: okhttp/3.7.0 0x12: application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12: application/json 0x16:
Basic QWxhZGRpbjpPcGVuU2VzYW1l Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 4 -
Client Server GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12:
application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 2 HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 ID: 4 -
Client Server GET / HTTP/1.1 0x25: square.com:443 0x39: okhttp/3.7.0 0x12:
application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 2 HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 ID: 4 -
Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21:
"686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 HTTP/1.1 200 OK 0x1E: application/json 0x1B: 471 0x21: "ae7284b30ccc93" 0x2B: Wed, 19 Apr 2017 09:22:09 GMT ID: 4 -
Client Server HTTP/1.1 200 OK 0x1E: application/json 0x1B: 42 0x21:
"686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 HTTP/1.1 200 OK 0x1E: application/json 0x1B: 471 0x21: "ae7284b30ccc93" 0x2B: Wed, 19 Apr 2017 09:22:09 GMT ID: 4 -
Client Server 0x08 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B:
Thu, 20 Apr 2017 12:45:26 GMT ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 0x08 0x1E: application/json 0x1B: 471 0x21: "ae7284b30ccc93" 0x2B: Wed, 19 Apr 2017 09:22:09 GMT ID: 4 -
Client Server 0x08 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B:
Thu, 20 Apr 2017 12:45:26 GMT ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 0x08 0x1E: 0x1A 0x1B: 471 0x21: "ae7284b30ccc93" 0x2B: Wed, 19 Apr 2017 09:22:09 GMT ID: 4 -
Client Server 0x08 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B:
Thu, 20 Apr 2017 12:45:26 GMT ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 2 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 0x08 0x1E: 0x1A 0x1B: 471 0x21: "ae7284b30ccc93" 0x2B: Wed, 19 Apr 2017 09:22:09 GMT ID: 4 -
Client Server ID: 2 GET / HTTP/1.1 0x25: square.com:443 0x39:
okhttp/3.7.0 0x12: application/json 0x16: Basic QWxhZGRpbjpPcGVuU2VzYW1l ID: 2 0x08 0x1E: application/json 0x1B: 42 0x21: "686897696a7c876b7e" 0x2B: Thu, 20 Apr 2017 12:45:26 GMT ID: 2 {"id":1234,"amount":420 ID: 2 0,"currency":"USD"} ID: 4 GET /api/payments HTTP/1.1 0x25: 0x01 0x39: 0x02 0x12: 0x03 0x16: 0x04 ID: 4 0x08 0x1E: 0x1A 0x1B: 471 0x21: "ae7284b30ccc93" 0x2B: Wed, 19 Apr 2017 09:22:09 GMT -
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()
.url("https://twitter.com") .build(); Call call = client.newCall(request); Response response = call.execute(); System.out.println(response.protocol()); -
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()
.url("https://twitter.com") .build(); Call call = client.newCall(request); Response response = call.execute(); System.out.println(response.protocol()); -
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()
.url("https://twitter.com") .build(); Call call = client.newCall(request); Response response = call.execute(); System.out.println(response.protocol()); h2 -
{"id":1234,"amount":4200,"currency":"USD"} JSON message Payment { string id = 1; int32
amount = 2; Currency currency = 3; } enum Currency { USD = 1; } Protocol Buffers -
{"id":1234,"amount":4200,"currency":"USD"} JSON message Payment { string id = 1; int32
amount = 2; Currency currency = 3; } enum Currency { USD = 1; } Protocol Buffers 1=1234 2=4200 3=1 -
{"id":1234,"amount":4200,"currency":"USD"} JSON message Payment { string id = 1; int32
amount = 2; Currency currency = 3; } enum Currency { USD = 1; } Protocol Buffers 1=1234 2=4200 3=1 0104D20210680301 -
{"id":1234,"amount":4200,"currency":"USD"} JSON message Payment { string id = 1; int32
amount = 2; Currency currency = 3; } enum Currency { USD = 1; } Protocol Buffers -
[ Y{"id":1234,"amount":4200,"currency":"USD"},Y {"id":1275,"amount":10000,"currency":"USD"}, {"id":1690,"amount":834,"currency":"USD"}, {"id":2641,"amount":2448,"currency":"USD"}, {"id":2903,"amount":11305,"currency":"USD"}, {"id":4991,"amount":566,"currency":"USD"}, {"id":5312,"amount":702,"currency":"USD"}, {"id":5319,"amount":3885,"currency":"USD"}, {"id":14328,"amount":34400,"currency":"USD"},
{"id":28321,"amount":892,"currency":"USD"}, {"id":29948,"amount":2261,"currency":"USD"}, {"id":30991,"amount":6600,"currency":"USD"}, {"id":37174,"amount":939,"currency":"USD"}, {"id":73572,"amount":40000,"currency":"USD"} ] -
[ Y{"id":1234,"amount":4200,"currency":"USD"},Y {"id":1275,"amount":10000,"currency":"USD"}, {"id":1690,"amount":834,"currency":"USD"}, {"id":2641,"amount":2448,"currency":"USD"}, {"id":2903,"amount":11305,"currency":"USD"}, {"id":4991,"amount":566,"currency":"USD"}, {"id":5312,"amount":702,"currency":"USD"}, {"id":5319,"amount":3885,"currency":"USD"}, {"id":14328,"amount":34400,"currency":"USD"},
ByteString("amount") ByteString("currency") ByteString("id") Adapter<Long> Adapter<CurrencyCode> Adapter<Long> Adapter<Payment>