3

What's the idiomatic way to return an HTTP 201 on a successful POST with grpc-gateway?

Writing a filter function seemed promising, but I'm not sure how to do this generically since I don't have access to the request (and can't determine the HTTP verb used)

Replacing a response forwarder seems to have all the needed information, but it requires wiring up on every applicable request, which can be error-prone.

I know there's not an equivalent gRPC status to HTTP 201 that can be mapped, so this would have to live entirely in the grpc-gateway code.

DMac the Destroyer
  • 5,240
  • 6
  • 36
  • 56

0 Answers0