Saturday, July 04, 2020

gRPC + Postman?

gRPC + Postman = Jason Newman - Medium

... complaints from our transition to gRPC has been the inability to use Postman for our gRPC services. The existing tooling has not met the ease of use the Postman providing for interacting with our traditional REST APIs. We have tried the gRPC CLI, grpc-gateway, and omgRPC

one solution:

adding a JSON codec to gRPC servers. While amazing, it wasn’t initially clear how this could be used to improve development workflows, especially given the reluctance of Postman to support HTTP/2 and the required binary header for the gRPC payload (whether a protocol buffer or JSON payload).

proof of concept proxy which handles the protocol conversion from HTTP to HTTP/2 and also calculates and inserts the gRPC payload header. On the response , it trims the header off of the gRPC response and converts the gRPC status code to a HTTP status code. The introduction of this proxy allows us to once again use the incredible collaboration and templating features of Postman with our gRPC services