Can I define a grpc call with a null request or response?

Does the rpc syntax in proto3 allow null requests or responses?

e.g. I want the equivalent of the following:

rpc Logout;
rpc Status returns (Status);
rpc Log (LogData);

Or should I just create a null type?

message Null {};

rpc Logout (Null) returns (Null);
rpc Status (Null) returns (Status);
rpc Log (LogData) returns (Null);

3 Answers
3

Leave a Comment