Insomnia supports all four RPC types defined by gRPC:
The following examples use hello.proto from grpcb.in.
These examples expect a request body containing a greeting
element. For example:
/hello.HelloService/SayHello
is unary RPC. You send a single message, and the server responds with a single message.
Specify a body, and click Send.
/hello.HelloService/LotsOfReplies
is server streaming RPC. You send a single message, and the server responds with multiple messages.
Specify a body, and click Send.
Note: The time it takes to respond depends on the server. In the example below, the second request uses grpcbin.proto, where the server stream responds much slower, and is easier to visualize.
/hello.HelloService/LotsOfGreetings
is client streaming RPC. You send multiple messages and the server responds with a single message.
Click Start to open a channel with the server, then edit the body with the contents of your first message and click Stream to send that message. You should see a read-only snapshot of the message appear as a tab. You can now edit the contents in the Body tab again, and click Stream each time you want to send a new message. Once all messages have been sent, click Commit and the server should respond accordingly.
/hello.HelloService/BiDiHello
is bidirectional streaming RPC. You send multiple messages, and the server responds with multiple messages.
This is a combination of server and client streaming. As such, the steps to send messages are identical to client streaming above, and the manner in which the server responds is identical to server streaming. Be sure to click Commit once you have finished sending all your messages, and allow the server to terminate the connection.