Forrest logo
back to the grpcurl tool

grpcurl:tldr:bbd17

grpcurl: Send a request with a header and a body.
$ grpcurl -H "${Authorization: Bearer $token}" -d ${'{"foo": "bar"}'} ${grpc-server-com:443} ${my-custom-server-Service-Method}
try on your machine

The command you provided is used to make a gRPC call to a server using the grpcurl command-line tool. Here is the explanation of each part of the command:

  • grpcurl: The command-line tool used for making gRPC requests.
  • -H "${Authorization: Bearer $token}": This option sets the Authorization header with a Bearer token. The value of the token is stored in the environment variable $token.
  • -d ${'{"foo": "bar"}'}: This option specifies the data payload for the gRPC request. In this case, it sends a JSON payload with a single field "foo" set to "bar".
  • ${grpc-server-com:443}: This is the target server address to which the gRPC request will be made. It specifies the hostname of the server (grpc-server-com) and the port (443).
  • ${my-custom-server-Service-Method}: This represents the fully-qualified name of the gRPC service and method endpoint being called. It identifies the specific method of the gRPC service on the server that will handle the request.

To summarize, this command makes a gRPC request to a server at the specified address by sending a JSON payload as the gRPC request data and including an Authorization header with a Bearer token.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the grpcurl tool