Answer the question
In order to leave comments, you need to log in
How to add REST API support using google.api.http on gRPC service?
Can you please tell me how to add REST API support using google.api.http?
syntax = "proto3";
import "google/api/annotations.proto";
service TestService {
rpc Method(MethodRequest) returns (MethodResponse) {
option (google.api.http) = {
post: "/api/v1/test:method"
body: "*"
};
}
}
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
stt_pb2_grpc.add_TestServiceServicer_to_server(
TestService(), server
)
address = f"{host}:{port}"
server.add_insecure_port(address)
server.start()
server.wait_for_termination()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question