From bd0f5edddfbb5b21146f30b2a687db4c5a51df3c Mon Sep 17 00:00:00 2001 From: Fuyang Liu Date: Tue, 14 Jan 2020 16:55:59 +0100 Subject: [PATCH] chore: Add grpcurl example in helloworld readme (#236) --- examples/helloworld-tutorial.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/helloworld-tutorial.md b/examples/helloworld-tutorial.md index 54bed74..c5e2bf9 100644 --- a/examples/helloworld-tutorial.md +++ b/examples/helloworld-tutorial.md @@ -238,9 +238,23 @@ async fn main() -> Result<(), Box> { } ``` -You should now be able to run your HelloWorld gRPC server using the command `cargo run --bin helloworld-server`. This uses the [[bin]] we defined earlier in our `Cargo.toml` to run specifically the server. If have a gRPC GUI client such as [Bloom RPC] you should be able to send requests to the server and get back greetings! +You should now be able to run your HelloWorld gRPC server using the command `cargo run --bin helloworld-server`. This uses the [[bin]] we defined earlier in our `Cargo.toml` to run specifically the server. + +If have a gRPC GUI client such as [Bloom RPC] you should be able to send requests to the server and get back greetings! + +Or if you use [grpcurl] then you can simply try send requests like this: +``` +$ grpcurl -plaintext -import-path ./proto -proto helloworld.proto -d '{"name": "Tonic"}' localhost:50051 helloworld.Greeter/SayHello +``` +And receiving responses like this: +``` +{ + "message": "Hello Tonic!" +} +``` [bloom rpc]: https://github.com/uw-labs/bloomrpc +[grpcurl]: https://github.com/fullstorydev/grpcurl ## Writing our Client