Intro to gRPC
1. Differences between gRPC and REST APIs#
- gRPC utilizes
HTTP/2
whereas REST utilizesHTTP 1.1
- gRPC utilizes the protocol buffer data format as opposed to the standard JSON data format that is typically used within REST APIs
- With gRPC you can utilize
HTTP/2
capabilities such as server-side streaming, client-side streaming or even bidirectional-streaming should you wish.
Source: Go gRPC Beginners Tutorial | TutorialEdge.net
2. Helloworld#
2.1. Intsall protoc and plugins#
Ptotocol Buffers - David’s Blog
2.2. Install gRPC in your project#
❯ go get -u google.golang.org/grpc
2.3. HelloWorld example#
查看其他文章