-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Returning a primitive type as a response instead of proto messages #994
Comments
Could you show the exact JSON output you want? |
Its just a string without any keys more like html text.
|
You can try using the |
That returns HttpBody as raw binary instead of actual html on a browser |
Can you upload a sample program that exhibits that behavior? That would be a great test case for us to add. Thanks! |
Sure, the standard example when I added below option to mux https://grpc-ecosystem.github.io/grpc-gateway/docs/httpbody.html |
The docs say that you need to use the |
The code you shared uses the |
Using this will return the original proto names something like |
The internal implementation also uses
|
The |
Have a look at |
I am having a use case if returning a primitive type as response even though the underlying grpc doesn't support returning primitive types as a response.
Wondering if its possible that I can return just a string as a response using grpc-gateway for below example rpc
Is it possible for the REST endpoint to just return string response without the the echomessage key?
The text was updated successfully, but these errors were encountered: