Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document how to pass payload from file, fixes #279 #281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

domdorn
Copy link

@domdorn domdorn commented Jan 25, 2022

No description provided.

Sometimes it might be necessary to read the payload from a file. This worked for some users:

```shell
grpcurl -d "$(cat my.json)" grpc.server.com:443 my.custom.server.Service/Method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the more straight-forward way, that doesn't require this particular feature in your shell, is to use the @ value as the input, very much like the example above.

Suggested change
grpcurl -d "$(cat my.json)" grpc.server.com:443 my.custom.server.Service/Method
grpcurl -d @ grpc.server.com:443 my.custom.server.Service/Method < my.json

@@ -146,6 +146,12 @@ grpcurl -d @ grpc.server.com:443 my.custom.server.Service/Method <<EOM
EOM
```

Sometimes it might be necessary to read the payload from a file. This worked for some users:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This worked for some users" -- this wording feels really non-committal. We can make it authoritative.

Suggested change
Sometimes it might be necessary to read the payload from a file. This worked for some users:
To use a file as the request payload, redirect the file to `grpcurl`'s stdin:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants