跳转到内容

欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。

GRPC

来自WHY42

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

[1]