What is the significance of the application/grpc content-type in gRPC requests?
Last updated
The
application/grpccontent-type header marks the HTTP/2 body as gRPC-framed, so proxies and servers route and parse it as gRPC rather than plain HTTP.A suffix names the codec (e.g.
application/grpc+json). The bare form implies Protobuf, with each message prefixed by a 1-byte compression flag and 4-byte length.Servers reject a wrong or missing content-type with a protocol error.
- https://grpc.github.io/grpc/core/md_doc__p_r_o_t_o_c_o_l-_h_t_t_p2.html
- https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md
- https://github.com/grpc/grpc-go/issues/5892
- https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
- https://www.koyeb.com/blog/enabling-grpc-and-http2-support-at-edge-with-kuma-and-envoy
- https://medium.com/coding-odyssey/grpc-with-spring-boot-deep-dive-with-interview-questions-48aa83be0ec6
- https://medium.com/@QuarkAndCode/grpc-for-microservices-http-2-streaming-grpc-web-routing-da556bf32324
- https://dmitrii.app/api-first-design-grpc-rest-and-sse-from-a-single-source-of-truth-rust-flutter/