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

[Feature Request] gRPCurl code generator #183

Open
gianlucaparadise opened this issue Mar 13, 2023 · 0 comments
Open

[Feature Request] gRPCurl code generator #183

gianlucaparadise opened this issue Mar 13, 2023 · 0 comments

Comments

@gianlucaparadise
Copy link

gianlucaparadise commented Mar 13, 2023

It would be nice to have the possibility to generate a gRPCurl command starting from an httpyac request. This feature should be similar to the generate shell - curl feature available for http requests.

The easiest structure of a grpcurl command is:

grpcurl \
    -H 'my-metadata: my-value' \
    -H 'my-other-metadata: my-other-value' \
    -d '{ "my_request_field": "my_request_value" }' \
    -plaintext {{host}} {{service}}/{{method}}

plaintext is needed for servers without TLS.

Examples

This:

GRPC grpcb.in:9000/grpcbin.GRPCBin/DummyUnary

{
    "fString": "my value"
}

Generates:

grpcurl \
    -d '{ "fString": "my value" }' \
    -plaintext grpcb.in:9000 grpcbin.GRPCBin/DummyUnary

And this:

GRPC grpcb.in:9000/grpcbin.GRPCBin/HeadersUnary
my-metadata: my-value

Generates:

grpcurl \
    -H 'my-metadata: my-value' \
    -plaintext grpcb.in:9000 grpcbin.GRPCBin/HeadersUnary
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

No branches or pull requests

1 participant