Sunday, October 25, 2020

REST => gRPC-Web, with WASM & Blazor

 10 Steps to Replace REST Services with gRPC-Web in Blazor WebAssembly | Syncfusion Blogs

In modern web applications, the common way data is exchanged between client and server is through REST (representational state transfer) services. JSON is the standard file format for this two-way communication. In REST, the client makes a request to a specific endpoint, and the server responds to it.


gRPC uses Protobuf (Protocol Buffers) as the format for the payload and supports all kinds of streaming:
Server-side streaming
Client-side streaming
Bidirectional streaming

From a performance point of view, Protobuf is an efficient binary message format. Protobuf serialization results in small message payloads, which is important in limited-bandwidth scenarios like mobile and web apps.


or just use JavaScript...

grpc-web - npm

gRPC-Web provides a Javascript library that lets browser clients access a gRPC service. You can find out much more about gRPC in its own website.


This library is intended for both JavaScript and TypeScript usage from a web browser or NodeJS (see Usage with NodeJS).

No comments: