I have a grpc server running at 0.0.0.0:50051. I'll show how you can use grpcurl
to test it.
Before that, install grpcurl
(mybe using go).
- List services the server provides:
user@matin ~/o/g/examples ((v1.55.1))> grpcurl -plaintext localhost:50051 list
grpc.health.v1.Health
grpc.reflection.v1alpha.ServerReflection
helloworld.Greeter
user@matin ~/o/g/examples ((v1.55.1))>
- Describe
user@matin ~/o/g/examples ((v1.55.1))> grpcurl -plaintext localhost:50051 describe helloworld.Greeter
helloworld.Greeter is a service:
service Greeter {
rpc SayHello ( .helloworld.HelloRequest ) returns ( .helloworld.HelloReply );
rpc SayHelloAgain ( .helloworld.HelloRequest ) returns ( .helloworld.HelloReply );
rpc SayHelloStreamReply ( .helloworld.HelloRequest ) returns ( stream .helloworld.HelloReply );
}
user@appsCode ~/o/g/examples ((v1.55.1))>
- Invoke a RPC
user@matin ~/o/g/examples ((v1.55.1))> grpcurl -plaintext -d '{"name": "matin"}' localhost:50051 helloworld.Greeter.SayHello
{
"message": "Hello matin"
}
user@matin ~/o/g/examples ((v1.55.1))>