Title: How to read input http body bytes using gRPC-JSON Transcoder?
Description:
We have exposed our gRPC APIs as JSON using gRPC-JSON Transcoder of Envoy and it works like a charm.
We are looking forward to integrating the third party application which supports webhook for integration. Apparently, the third-party application sends data as 'form-data' and not like a JSON.
You can find sample details

How should we configure proto annotations such that it can convert incoming HTTP request body bytes to proto message bytes attribute?
Is it possible to achieve the same using gRPC-JSON Transcoder?
@mahesh0723 not quite sure what is meant by proto annotations here, can you provide more context?
gRPC-JSON Trancoder currently supports requests with only JSON format, not multipart/form-data.
According to docs below, bytes seem to be interpreted as a base64 string. If you want to send bytes data, you must convert it to base64 and send with JSON format.
https://developers.google.com/protocol-buffers/docs/proto3#json
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
We just had a use case for this ourselves. I think it would be great if supported was added for passing the body as bytes. Perhaps something like this:
rpc ReceiveData(ReceiveDataRequest) returns (Empty) {
option (google.api.http) = {
post: "/some/path"
body_bytes: "data"
};
}
...
message ReceiveDataRequest {
bytes data = 1;
}
The body_bytes option would tell the transcoder not to decode the body as json, but rather, pass the body bytes as the data field. If the data field was not bytes, this would be flagged as an error, and if both body_bytes and body options were specified, this would also be flagged as an error.
Most helpful comment
We just had a use case for this ourselves. I think it would be great if supported was added for passing the body as bytes. Perhaps something like this:
The
body_bytesoption would tell the transcoder not to decode the body as json, but rather, pass the body bytes as the data field. If thedatafield was notbytes, this would be flagged as an error, and if bothbody_bytesandbodyoptions were specified, this would also be flagged as an error.