Skip to content

Instantly share code, notes, and snippets.

@tzmfreedom
Last active February 16, 2020 14:10
Show Gist options
  • Save tzmfreedom/435e44d5e297f467946eb95c3a4835ef to your computer and use it in GitHub Desktop.
Save tzmfreedom/435e44d5e297f467946eb95c3a4835ef to your computer and use it in GitHub Desktop.

curlでgrpc叩く(あらかじめ grpc-json-proxyを起動する必要あり)

$ curl -X POST \
    -H 'Content-Type: application/grpc+json' \
    -H "Grpc-Insecure:true" \
    -x http://localhost:7001  \
    -d '{"name":"hogehoge"}' \
    http://127.0.0.1:50051/helloworld.Greeter/SayHello

grpcurlで叩く

$ grpcurl -rpc-header "hoge: ufag" \
    -plaintext -d {} localhost:50051 helloworld.Greeter/SayHello

grpc-dump

$ grpc-dump -port 12345 -destination 127.0.0.1:50051 | jq .service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment