Basic client example isn't working - any ideas on how to proceed with 415 error code? #622
-
Hello, I have a Kotlin-backed gRPC endpoint which is verified to work with different clients in Kotlin/Java. I'm attempting to access it through the protobuf-es + connect-es setup in my Node TS application. I am receiving the following client side error The server side error isn't really helpful I've tried 3 different transport options (GrpcTransport, GrpcWebTransport, and ConnectTransport) but they all fail with a simple gRPC request using the example PromiseClient. Example transport
Any ideas on how to proceed? I've used https://github.com/stephenh/ts-proto + https://github.com/deeplay-io/nice-grpc and am able to access the gRPC endpoint so its either something with the generated TS files (I doubt it) or the client call itself. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Which protocol is your kotlin-backed gRPC endpoint serving? I'd guess "normal" gRPC, so only grpcTransport will work. I assume you've tried with An HTTP 415 error means that the client sent/requested an "Unsupported Media Type", which I'd expect if you're trying to connect with connectTransport or grpcWebTransport if your server isn't actually serving those protocols. You show how you configure the transport. Can you show how you import and configure the client, too? You're using connect-node, right? https://www.npmjs.com/package/@bufbuild/connect-node |
Beta Was this translation helpful? Give feedback.
The spec allows both
application/grpc
andapplication/grpc+proto
for the binary protobuf format, so it might be a good call to allow both on the server.You can use an interceptor to modify the request headers:
Usage: