I had Asp.net core and gRPC working on the browser...but now I get:
info: Grpc.AspNetCore.Server.ServerCallHandler[2]
Request content-type of 'application/grpc-web' is not supported.
Any ideas on how to track this down?
I had Asp.net core and gRPC working on the browser...but now I get:
info: Grpc.AspNetCore.Server.ServerCallHandler[2]
Request content-type of 'application/grpc-web' is not supported.
Any ideas on how to track this down?
Likely an issue in your Startup.cs
Yours should look something like this
My guess is that you are missing app.UseGrpcWeb()
or the EnabledGrpc()
on the EndpointConventionBuilder
I ran across this issue. I had my app.UseGrpcWeb();
before app.UseRouting();
It had to be after.
So correct order is:
app.UseRouting();
app.UseGrpcWeb();
See https://learn.microsoft.com/en-us/aspnet/core/grpc/browser?view=aspnetcore-5.0 -- "Configure gRPC-Web in ASP.NET Core"
© 2022 - 2024 — McMap. All rights reserved.