Testing your GRPC using Postman
Step by step testing GRPC using Postman

Postman is an application used for API testing. It is an HTTP client that tests HTTP requests, utilizing a graphical user interface, through which we obtain different types of responses that need to be subsequently validated.
In this tutorial i’ll explain how to testing our GRPC services using postman. In this example we will using golang to create our simple hello world services.
Postman Version
Make sure your postman is version v9.7.1+ or you can download from here
Install golang
Here i’m using go version go1.16.9 darwin/amd64

Install golang dependency
Install protobuf module by using command go get
go get google.golang.org/protobuf/runtime/protoimpl@v1.26.0
go get google.golang.org/protobuf/reflect/protoreflect@v1.26.0

Create Golang file and Go mod
Create new folder called go-simple-grpc or whatever you want and create new file main.go.
Also create go module by typing go mod init golang/simple-grpc.
go mod init golang/simple-grpc
Create proto file
now we will create new folder called proto and create proto file called hello.proto and paste this example to your file.
So now project directory will like this

Generate protobuf file
Now we will generate protocol buffer wo our project, first go to your project in terminal

Eventually execute this command from here, this will generate implementation of protocol buffer you can see details in here
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./proto/*.proto
so our project directory will be like this.

Fill main.go file
Now fill main.go with this code, this code will implement grpc services based on our proto file
now we can run our grpc service in terminal, now type go run main.go in our terminal like this. Now our services is running 🚀🚀

Testing in postman
Now we will test our hello service in postman, open our postman and create new request

Now click on grpc request

Eventually fill this value like this, then upload our local proto to postman
server url: localhost:9090

Then filling detail our proto file like this, it will saved in our postman api later.
schema : Protobuf 3
name : HelloService
version name : 1.0.0

Next is choose method that we want to test in HelloService which is SayHello method.

Lasthing is filling our payload to send to our grpc service like this
{
"name": "Hello world"
}

Then click invoke button in postman and boom 💥 , we get our response in postman.

So simple isn’t ?, we can also test for another method in our HelloService same as like above method.