← All features

gRPC

gRPC calls, written as JSON

Call gRPC methods from the same .http files as your REST requests, in the JetBrains syntax. Write the request message as JSON and read the reply as JSON: Reqjet works out the protobuf from the server or your .proto files.

How it works

No generated code, no extra tool

  • One line: GRPC host:port/package.Service/Method, with the message as a JSON body and headers sent as metadata. grpcs:// connects with TLS.
  • Server reflection: Reqjet asks the server for its methods and messages, so most development servers need nothing else.
  • Or your .proto files: name them with @reqjet.proto, for one request or the whole file. Imports and Google's standard types are found for you.
  • Mistakes explained: a wrong service, method or field isn't sent. Reqjet lists what the server does offer instead.
  • Streaming too: send a JSON array of messages up, and get every reply back in a JSON array.
api/orders.http
# @reqjet.proto ./protos/orders.proto

### Get an order
# @reqjet.assert grpc.status == OK
# @reqjet.assert body.$.status == SHIPPED
GRPC {{grpcHost}}/shop.v1.Orders/GetOrder
authorization: Bearer {{$auth.token("orders")}}

{ "id": "o-1" }

### Watch it (server streaming)
GRPC {{grpcHost}}/shop.v1.Orders/Watch

{ "id": "o-1" }

Like any other request

Everything you use for REST works

  • Tests: check grpc.status, grpc.message, the reply's fields and its metadata, in the app, in Run all and on the command line.
  • The reply: the status (OK, NOT_FOUND…) in the status pill, with its message, and the metadata and trailers in Headers.
  • Variables and chaining: environments, {{variables}}, OAuth tokens, client certificates and one reply's values in the next request.
  • History, snapshots and retries: compare replies, save them as snapshots, and retry when the server is UNAVAILABLE.
  • Copy as cURL gives the matching grpcurl command.
protos/orders.proto
syntax = "proto3";
package shop.v1;

service Orders {
  rpc GetOrder (GetOrderRequest) returns (Order);
  rpc Watch (GetOrderRequest) returns (stream Order);
}

message GetOrderRequest { string id = 1; }

message Order {
  string id = 1;
  int64 total_pence = 2;
  Status status = 3;
  enum Status { UNKNOWN = 0; PLACED = 1; SHIPPED = 2; }
}
Reqjet logo

Try it on your own requests

Free for Windows, macOS and Linux, and it opens the .http files you already have.