gRPC & ASP.NET Core 5: Discover gRPCui, the GUI alternative to gRPCurl
Introduction
In a previous article, I have introduced you gRPCurl a command line tool that allows you test you gRPC endpoints: gRPC & ASP.NET Core 5: Test gRPC endpoints with gRPCurl – Anthony Giretti’s .NET blog. In this article I’ll introduce you gRPCui which is quite the same tool, but available as a web tool, built on top on gRPCurl.
Install gRPCui
Because its a GUI built on top of gRPCurl, you’ll need, like this latter to install GO on your machine, you can find the tutorial in my previous article here again: gRPC & ASP.NET Core 5: Test gRPC endpoints with gRPCurl – Anthony Giretti’s .NET blog. Like gRPCurl, you don’t need to install any proto files, gRPCui uses gRPC Reflection as well.
Once installed, you’ll need to download and install gRPCui with the following commands (I suggest you to install it via a PowerShell windows as Administrator):
go get github.com/fullstorydev/grpcui/...
go install github.com/fullstorydev/grpcui/cmd/grpcui
Then run the following command via a PowerShell command for example:
grpcui {yourgrpcapplicationurl}:{yourgrpcapplicationport}
You need here to provide the URl and the port of you gRPC service because gRPCui cannot guess it obviously. If the installation succeed you should have something like this in return of your command:
gRPCui will expose a local URI that is the URI of the GUI you use to test you gRPC services as shown in the following:
Play with gRPCui
The UI is very intuitive, you can easily find the service to test and its method in the dropdown list at the top. Create your request is also intuitive, you can easily fill:
- Request Metadata (Trailers)
- Request Data (Fill streamed data or not is the same, like a collection to fill)
- Request Timeout (Deadline)
If you service return an Empty message, the response should like this, an empty Response Data section, a Response Header section empty or not depending on what the gRPC service sends back and a Response Trailers section filled at least with: content-length, content-type, data and server name:
If the response is a non Empty message, Response Headers section is filled instead of the Response Trailers section. (Empty responses have metadata put into Trailers instead of Headers):
If you like this tool and want to learn more about it you can find a complete documentation here: fullstorydev/grpcui: An interactive web UI for gRPC, along the lines of postman (github.com)