How is the gRPC status code communicated back to the client using HTTP/2 trailers?
Last updated
gRPC sends the final call status in HTTP/2 trailers (the trailing HEADERS frame), while the HTTP status is almost always
200 OK.grpc-statuscarries the numeric code (0 =OK),grpc-messagean optional description, andgrpc-status-details-binoptional rich error details.Trailers are used because status is only known after the response (especially streams) finishes. Immediate failures can send a single "Trailers-Only" HEADERS frame with no body.
- https://grpc.github.io/grpc/core/md_doc__p_r_o_t_o_c_o_l-_h_t_t_p2.html
- https://www.httpdebugger.com/debug/grpc-calls
- https://kreya.app/blog/grpc-deep-dive/
- https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
- https://grpc.io/docs/guides/error/
- https://itnext.io/enhancing-grpc-error-handling-in-a-microservice-architecture-2086253930bd
- https://dev.to/tjindapitak/why-grpc-is-not-natively-supported-by-browsers-3oj5