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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:


```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

```

### Listing Services
To list all services exposed by a server, use the "list" verb. When using `.proto` source
or protoset files instead of server reflection, this lists all services defined in the
Expand Down