3

I want to connect to deployed grpc server by given ipaddress and host like 192.168.0.1:50032 i tried many stuff but as i checked grpc recommendation to have grpc client but i want to try how to post via postman or any by grpc interfaces server. Any suggestion?

Vitaly Isaev
  • 5,392
  • 6
  • 45
  • 64
Yabetsu2018
  • 133
  • 1
  • 15

4 Answers4

3
conn, err := grpc.Dial("192.168.0.1:50032")
if err != nil {
    ...
}

Here's a basic tutorial you should follow

Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
  • My problem is the grpc server was deployed and need to connect to the ipaddress and host only like this post. https://medium.com/@jnewmano/grpc-postman-173b62a64341 – Yabetsu2018 May 01 '19 at 13:40
1

Basically you're not able to post GRPC request via Postman, because GRPC messages are binary (protobuf-serialized), while Postman is designed to work only with plain HTTP requests. You'll have to deploy some kind of proxy in front of your service in order to use Postman.

From my point of view, it's much easier just to write your client that fits your needs. The greatest part of job is already done by protoc-gen-grpc, because it generates client API, and you need just to build request and send it.

Vitaly Isaev
  • 5,392
  • 6
  • 45
  • 64
0

You cant use http client to send requests against http2 server, but you can do it with any of available h2 client tools.. For example https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md.

ArkadyB
  • 1,265
  • 1
  • 19
  • 37
0

@Eli Bendersky : Setting up the client side answer my question also this code I used

conn, err := grpc.Dial("192.168.0.1:50032", grpc.WithInsecure)

Thank you for your help.

Yabetsu2018
  • 133
  • 1
  • 15