Monday, July 06, 2020

gRPC with Blazor WebAssembly

How to Utilize gRPC-Web From a Blazor WebAssembly Application

"It is currently impossible to implement the gRPC HTTP/2 spec in the browser because there are no browser APIs with enough fine-grained control over requests. Well the good news is that gRPC-Web is here for the rescue!!!

gRPC-Web is a standardized protocol that solves this problem and makes gRPC usable in the browser. gRPC-Web brings many of gRPC’s great features, like small binary messages and contract-first APIs, to modern browser apps. In this post I will demonstrate consuming a gRPC-Web endpoint from within a Blazor WebAssembly application. Along the way I will also demonstrate how gRPC-Web can achieve more efficient payload sizes compared to Restful endpoints."