Hi,

The REST API annotation is not a native feature of gRPC. Using gRPC Python 
(based on the snippet) won't be able to spawn an HTTP/1.1 server with the 
given interface.

However, there are multiple projects that can handle the HTTP/1.1 and 
HTTP/2 (gRPC) translation for you. For example: 
https://github.com/grpc-ecosystem/grpc-gateway

On Friday, January 14, 2022 at 9:18:39 AM UTC-8 MAX IKON wrote:

> 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" body: "*" }; } }
> What should be added here?
> 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()
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/475df23f-a151-4791-be48-8374f49d483cn%40googlegroups.com.

Reply via email to