
Microservices Communication in .NET Using gRPC
By :

Each remote procedure call in gRPC must have a request and a response message defined. You cannot have an RPC that doesn't accept an input parameter or doesn't return an output object. However, there are many use cases where either a request parameter or a response object would be redundant. For example, if you would want to retrieve a full unfiltered collection of data, you wouldn't need to specify the request attributes. Likewise, if you want to submit a new entry to the server, you probably won't expect to receive any data back. All you'll need is a basic confirmation that your action was successful.
When you use standard HTTP, both of these actions are easily achievable. A simple GET
request that contains only a URL path and no parameters can be made to obtain an unfiltered collection of data. Likewise, when you submit a PUT
, POST
, PATCH
, or DELETE
request, you won't usually receive any data back (although in some situations...