grpcurl icon indicating copy to clipboard operation
grpcurl copied to clipboard

add/document way of passing inputs from a file

Open domdorn opened this issue 3 years ago • 2 comments
trafficstars

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.

domdorn avatar Jan 20 '22 09:01 domdorn

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!

TeoZosa avatar Jan 24 '22 20:01 TeoZosa

awesome @TeoZosa , this works!

domdorn avatar Jan 25 '22 12:01 domdorn