You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for application/grpc-web+json which is identical to grpc-web, but uses the canonical JSON representation instead of protobuf.
Crates
tonic-web
tonic
Motivation
grpc-web+json is advantageous for browser based clients because data is serialized in a format natively understood by JavaScript (JSON). Eliminating protobuf serialization can reduce library dependency and significantly reduce package sizing while also providing performance benefits.
Proposal
Detect Content-Type: application/grpc-web+json and switch to the Json codec in tonic-web.
Alternatives
This may be especially difficult because, currently, supporting both grpc and grpc+json requires building twice and switching codec implementations based on headers. See #851.
As an alternative, tonic-web could be updated to be agnostic of the content type and applications could switch services based on content type similar to workaround for grpc+json.
The text was updated successfully, but these errors were encountered:
Feature Request
Add support for
application/grpc-web+json
which is identical togrpc-web
, but uses the canonical JSON representation instead of protobuf.Crates
tonic-web
tonic
Motivation
grpc-web+json
is advantageous for browser based clients because data is serialized in a format natively understood by JavaScript (JSON). Eliminating protobuf serialization can reduce library dependency and significantly reduce package sizing while also providing performance benefits.Proposal
Detect
Content-Type: application/grpc-web+json
and switch to the Json codec intonic-web
.Alternatives
This may be especially difficult because, currently, supporting both
grpc
andgrpc+json
requires building twice and switching codec implementations based on headers. See #851.As an alternative,
tonic-web
could be updated to be agnostic of the content type and applications could switch services based on content type similar to workaround forgrpc+json
.The text was updated successfully, but these errors were encountered: