-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about JSON #234
Comments
So you are asking for something that just translates the protobuf binary payloads to JSON? FWIW, streaming and other gRPC protocol features such as compression would not really work well with this. It sounds like maybe you are wanting a gRPC-web client that uses JSON, paired with a server that uses JSON. This is currently problematic because https://github.com/grpc/grpc-web uses a JS protobuf library that does not support JSON. So a few things you might instead consider:
|
I'm just looking for a way to consume the grpc server on a web frontend. |
@idc77, the "official" answer from the gRPC team is probably to use gRPC-Web: https://github.com/grpc/grpc-web
You might check out Connect: it was designed for web and mobile use cases. So it should be a much better experience. It supports JSON, it has a curl-friendly protocol for unary RPCs, and works in web (TS/JS) and mobile (Kotlin and Swift). |
When I use grpcui, it's able to receive JSON requests, forward them to my grpc server and receive a response and return JSON as well.
It that something so easy to do?
Why don't you release a standalone grpc to JSON gateway?
Or have I been living under a rock for the last few years?
I've always waited for grpc-web to be complete but it never is, yet here you have a middleware that simply constructs clients by reflection and posts and receives JSON objects. Mind blown.
How?
Can I simply add some magic package and have that functionality as well?
The text was updated successfully, but these errors were encountered: