I am working on implementing the gRPC generated code for the flatbuffers library, and I've noticed that the python gRPC library doesn't use the user set content-type
. According to the documentation the user can set whatever type they want in the Content-Type → "content-type" "application/grpc" [("+proto" / "+json" / {custom})]
section. I've been trying to add simply send a +flatbuffers
which breaks the go server and the python client (trying to make sure that all the languages can work well without any issues between them).
example: Go lang to Go lang
:method POST
:scheme http
:path /models.Greeter/SayHello
:authority localhost:3000
content-type application/grpc+flatbuffers
user-agent grpc-go/1.35.0
te trailers
grpc-timeout 9997779u
As you can see if its being called from go lang it doesn't have issues however when I call the server from the python client it clearly doesn't append the +flatbuffers
suffix
python to Go lang
:scheme http
:method POST
:authority localhost:3000
:path /models.Greeter/SayHello
te trailers
content-type application/grpc
user-agent grpc-python/1.35.0 grpc-c/14.0.0 (osx; chttp2)
steps taken: 1- I've tried adding options to the channel:
with grpc.insecure_channel('localhost:' + args.port, options=[('content-type', 'application/grpc+flatbuffers')]) as channel:
2- I've tried adding it on to the with_call
according to https://github.com/grpc/grpc/blob/v1.35.0/examples/python/metadata/metadata_client.py
with_call(hello_request, metadata=[('content-type', 'application/grpc+flatbuffers')], compression=None)
however both options fail.
am I missing something here?