top | item 40812885

(no title)

ainar-g | 1 year ago

Re. bad tooling. grpcurl[1] is irreplaceable when working with gRPC APIs. It allows you to make requests even if you don't have the .proto around.

[1]: https://github.com/fullstorydev/grpcurl

discuss

order

abdusco|1 year ago

> make requests even if you don't have the .proto around

Like this?

    > grpcurl -d '{"id": 1234, "tags": ["foo","bar"]}' \
        grpc.server.com:443 my.custom.server.Service/Method
How is that even possible? How could grpcurl know how to translate your request to binary?

ainar-g|1 year ago

If I recall correctly, ProtoBuf has a reflection layer, and it's probably using that.

BobbyJo|1 year ago

I could be wrong, but it is probably using json encoding for the object body, and implementing the transport for grpc instead of http. Proto objects support json encode/decode by default in all the implementations I've seen.

https://grpc.io/blog/grpc-with-json/

CommonGuy|1 year ago

One can use Kreya for a GUI version

jakjak123|1 year ago

I just build a cli in Java or Go. It literally takes minutes to build a client.