Grpc.Net.Client.Web 2.76.0
Grpc.Net.Client.Web
The .NET gRPC client can be configured to make gRPC-Web calls. This is useful for Blazor WebAssembly apps, which are hosted in the browser and have the same HTTP limitations of JavaScript code. Calling gRPC-Web with a .NET client is the same as HTTP/2 gRPC. The only modification is how the channel is created.
To use gRPC-Web:
- Add a reference to the Grpc.Net.Client.Web package.
- Ensure the reference to Grpc.Net.Client package is 2.29.0 or greater.
- Configure the channel to use the
GrpcWebHandler:
var channel = GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions
{
HttpHandler = new GrpcWebHandler(new HttpClientHandler())
});
var client = new Greeter.GreeterClient(channel);
var response = await client.SayHelloAsync(new HelloRequest { Name = ".NET" });
The preceding code:
- Configures a channel to use gRPC-Web.
- Creates a client and makes a call using the channel.
GrpcWebHandler has the following configuration options:
- InnerHandler: The underlying
HttpMessageHandlerthat makes the gRPC HTTP request, for example,HttpClientHandler. - GrpcWebMode: An enumeration type that specifies whether the gRPC HTTP request
Content-Typeisapplication/grpc-weborapplication/grpc-web-text.GrpcWebMode.GrpcWebconfigures content to be sent without encoding. Default value.GrpcWebMode.GrpcWebTextconfigures content to be base64 encoded. Required for server streaming calls in browsers.
GrpcChannelOptions.HttpVersion and GrpcChannelOptions.HttpVersionPolicy can be used to configure the HTTP protocol version.
gRPC-Web and streaming
Traditional gRPC over HTTP/2 supports streaming in all directions. gRPC-Web offers limited support for streaming:
- gRPC-Web browser clients don't support calling client streaming and bidirectional streaming methods.
- gRPC-Web .NET clients don't support calling client streaming and bidirectional streaming methods over HTTP/1.1.
- ASP.NET Core gRPC services hosted on Azure App Service and IIS don't support bidirectional streaming.
When using gRPC-Web, we only recommend the use of unary methods and server streaming methods.
Links
No packages depend on Grpc.Net.Client.Web.
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
.NET 10.0
- No dependencies.
.NET Standard 2.0
- System.Memory (>= 4.5.3)
.NET Standard 2.1
- No dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 2.84.0 | 4 | 09/23/2026 |
| 2.84.0-pre1 | 4 | 09/23/2026 |
| 2.83.0 | 5 | 08/06/2026 |
| 2.83.0-pre1 | 6 | 08/06/2026 |
| 2.80.0 | 5 | 08/06/2026 |
| 2.80.0-pre1 | 6 | 08/06/2026 |
| 2.76.0 | 6 | 08/05/2026 |
| 2.76.0-pre1 | 5 | 08/06/2026 |
| 2.71.0 | 6 | 08/06/2026 |
| 2.71.0-pre1 | 6 | 08/06/2026 |
| 2.70.0 | 5 | 08/06/2026 |
| 2.70.0-pre1 | 6 | 08/06/2026 |
| 2.67.0 | 5 | 08/06/2026 |
| 2.67.0-pre1 | 6 | 08/06/2026 |
| 2.66.0 | 5 | 08/06/2026 |
| 2.66.0-pre1 | 6 | 08/06/2026 |
| 2.65.0 | 5 | 08/06/2026 |
| 2.65.0-pre1 | 6 | 08/06/2026 |
| 2.64.0 | 5 | 08/06/2026 |
| 2.64.0-pre1 | 6 | 08/06/2026 |
| 2.63.0 | 6 | 08/06/2026 |
| 2.63.0-pre1 | 6 | 08/06/2026 |
| 2.62.0 | 5 | 08/06/2026 |
| 2.62.0-pre1 | 6 | 08/06/2026 |
| 2.61.0 | 5 | 08/06/2026 |
| 2.61.0-pre1 | 5 | 08/06/2026 |
| 2.60.0 | 5 | 08/06/2026 |
| 2.60.0-pre1 | 6 | 08/06/2026 |
| 2.59.0 | 5 | 08/06/2026 |
| 2.59.0-pre1 | 6 | 08/06/2026 |
| 2.58.0 | 5 | 08/06/2026 |
| 2.58.0-pre1 | 6 | 08/06/2026 |
| 2.57.0 | 5 | 08/06/2026 |
| 2.57.0-pre1 | 6 | 08/06/2026 |
| 2.56.0 | 5 | 08/06/2026 |
| 2.56.0-pre2 | 5 | 08/06/2026 |
| 2.56.0-pre1 | 6 | 08/06/2026 |
| 2.55.0 | 5 | 08/06/2026 |
| 2.55.0-pre1 | 6 | 08/06/2026 |
| 2.54.0 | 5 | 08/06/2026 |
| 2.54.0-pre1 | 5 | 08/06/2026 |
| 2.53.0 | 5 | 08/06/2026 |
| 2.53.0-pre1 | 6 | 08/06/2026 |
| 2.52.0 | 5 | 08/06/2026 |
| 2.52.0-pre1 | 6 | 08/06/2026 |
| 2.51.0 | 5 | 08/06/2026 |
| 2.51.0-pre1 | 5 | 08/06/2026 |
| 2.50.0 | 5 | 08/06/2026 |
| 2.50.0-pre1 | 5 | 08/06/2026 |
| 2.49.0 | 5 | 08/06/2026 |
| 2.49.0-pre1 | 6 | 08/06/2026 |
| 2.48.0 | 5 | 08/06/2026 |
| 2.48.0-pre1 | 6 | 08/06/2026 |
| 2.47.0 | 5 | 08/06/2026 |
| 2.47.0-pre1 | 6 | 08/06/2026 |
| 2.46.0 | 5 | 08/06/2026 |
| 2.46.0-pre1 | 6 | 08/06/2026 |
| 2.45.0 | 6 | 08/06/2026 |
| 2.45.0-pre1 | 5 | 08/06/2026 |
| 2.44.0 | 6 | 08/06/2026 |
| 2.44.0-pre1 | 6 | 08/06/2026 |
| 2.43.0 | 5 | 08/06/2026 |
| 2.43.0-pre1 | 6 | 08/06/2026 |
| 2.42.0 | 5 | 08/06/2026 |
| 2.42.0-pre1 | 5 | 08/06/2026 |
| 2.41.0 | 6 | 08/06/2026 |
| 2.41.0-pre1 | 6 | 08/06/2026 |
| 2.40.0 | 5 | 08/06/2026 |
| 2.40.0-pre1 | 6 | 08/06/2026 |
| 2.39.0 | 5 | 08/06/2026 |
| 2.39.0-pre1 | 5 | 08/06/2026 |
| 2.38.0 | 5 | 08/06/2026 |
| 2.38.0-pre1 | 5 | 08/06/2026 |
| 2.37.0 | 5 | 08/06/2026 |
| 2.37.0-pre1 | 6 | 08/06/2026 |
| 2.36.0 | 5 | 08/06/2026 |
| 2.36.0-pre1 | 6 | 08/06/2026 |
| 2.35.0 | 5 | 08/06/2026 |
| 2.35.0-pre1 | 6 | 08/06/2026 |
| 2.34.0 | 5 | 08/06/2026 |
| 2.34.0-pre1 | 6 | 08/06/2026 |
| 2.33.1 | 5 | 08/06/2026 |
| 2.33.1-pre1 | 5 | 08/06/2026 |
| 2.32.0 | 5 | 08/06/2026 |
| 2.32.0-pre1 | 6 | 08/06/2026 |
| 2.31.0 | 5 | 08/06/2026 |
| 2.31.0-pre2 | 5 | 08/06/2026 |
| 2.30.0 | 5 | 08/06/2026 |
| 2.30.0-pre1 | 6 | 08/06/2026 |
| 2.29.0 | 4 | 08/06/2026 |
| 2.29.0-pre1 | 6 | 08/06/2026 |
| 2.28.0-pre2 | 5 | 08/06/2026 |
| 2.28.0-pre1 | 6 | 08/06/2026 |
| 2.27.0-pre1 | 6 | 08/06/2026 |