fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.75k stars 502 forks source link

add/document way of passing inputs from a file #279

Open domdorn opened 2 years ago

domdorn commented 2 years ago

Hello!

I'm trying out grpcurl to test a grpc endpoint. I'm having a hard time doing so cause grcpurl does not support passing a input file.

Please add a way or document (if it already exists) how to load input data from a file.

If I pass a large json either directly with -d "myjson" or with the -d @ .. <<EOM way, I always get "too many arguments" as an error.

TeoZosa commented 2 years ago

Hey @domdorn!

If I pass a large json either directly with -d "myjson" or with the -d @ .. <<EOM way, I always get "too many arguments" as an error.

I was stuck on the same issue as well, have you tried -d "$(cat my.json)"? (double quotes mandatory to prevent word splitting)

A little hacky but ended up working for me!

domdorn commented 2 years ago

awesome @TeoZosa , this works!