prononstop113 commented on issue #170:
URL:
https://github.com/apache/apisix-java-plugin-runner/issues/170#issuecomment-1573519349
@tzssangglass
I tried to log request's body but it returned null:
the filter function :
```
public void filter(HttpRequest request, HttpResponse response,
PluginFilterChain chain) {
String configStr = request.getConfig(this);
Gson gson = new Gson();
Map<String, Object> conf = new HashMap<>();
// convert according to the actual configured conf type
conf = gson.fromJson(configStr, conf.getClass());
// get extra info
String remoteAddr = request.getVars("remote_addr");
String serverPort = request.getVars("server_port");
String body = request.getBody();
logger.info("this is request Body " +body); // use to log request's
body
}
```
the request body that I passed in api call :
```
{
"from": "mars",
"condition": "no oxygen"
}
```
apisix's log :

_APISIX version : 3.3.0
Java runner version : 0.4.0_
Expected result :
apisix's log has request's body
Actual result : null body
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]