GRPC

来自WHY42
Riguz讨论 | 贡献2024年1月18日 (四) 01:59的版本 (创建页面,内容为“= gRPC vs HTTP = {| class="wikitable" |- ! Feature !! gRPC !! HTTP APIs with JSON |- | Contract || Required (.proto) || Optional (OpenAPI) |- | Protocol || HTTP/2 || HTTP |- | Payload || Protobuf (small, binary) || JSON (large, human readable) |- | Prescriptiveness || Strict specification || Loose. Any HTTP is valid. |- | Streaming || Client, server, bi-directional || Client, server |- | Browser support || No (requires gr…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

gRPC vs HTTP

Feature gRPC HTTP APIs with JSON
Contract Required (.proto) Optional (OpenAPI)
Protocol HTTP/2 HTTP
Payload Protobuf (small, binary) JSON (large, human readable)
Prescriptiveness Strict specification Loose. Any HTTP is valid.
Streaming Client, server, bi-directional Client, server
Browser support No (requires grpc-web) Yes
Security Transport (TLS) Transport (TLS)
Client code-generation Yes OpenAPI + third-party tooling