istio-ecosystem / wasm-extensions

Contains miscellaneous Wasm extensions for Istio
Apache License 2.0
105 stars 34 forks source link

grpc_logging example get request body #82

Closed clarechu closed 2 years ago

clarechu commented 2 years ago

hi! how to get a request body in the grpc_logging example .

std::string request_body;
getValue({"response", "body"}, &request_body);

Can I get it this way?

bianpengyuan commented 2 years ago

You will need to use getbuffer: https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/9af5ac0145a8790f62ca501c43f6fa1ea24d2d93/proxy_wasm_common.h#L90

clarechu commented 2 years ago

@bianpengyuan ok, thanks