Search in sources :

Example 1 with HttpclientLogBodyMessage

use of com.dtflys.forest.backend.httpclient.logging.HttpclientLogBodyMessage in project forest by dromara.

the class AbstractHttpclientRequestSender method setLogBody.

protected <T extends HttpRequestBase> void setLogBody(RequestLogMessage logMessage, T httpReq) {
    HttpEntityEnclosingRequestBase entityEnclosingRequest = (HttpEntityEnclosingRequestBase) httpReq;
    HttpEntity entity = entityEnclosingRequest.getEntity();
    if (entity == null) {
        return;
    }
    LogBodyMessage logBodyMessage = new HttpclientLogBodyMessage(entity);
    logMessage.setBody(logBodyMessage);
}
Also used : HttpclientLogBodyMessage(com.dtflys.forest.backend.httpclient.logging.HttpclientLogBodyMessage) HttpEntityEnclosingRequestBase(org.apache.http.client.methods.HttpEntityEnclosingRequestBase) HttpEntity(org.apache.http.HttpEntity) LogBodyMessage(com.dtflys.forest.logging.LogBodyMessage) HttpclientLogBodyMessage(com.dtflys.forest.backend.httpclient.logging.HttpclientLogBodyMessage)

Aggregations

HttpclientLogBodyMessage (com.dtflys.forest.backend.httpclient.logging.HttpclientLogBodyMessage)1 LogBodyMessage (com.dtflys.forest.logging.LogBodyMessage)1 HttpEntity (org.apache.http.HttpEntity)1 HttpEntityEnclosingRequestBase (org.apache.http.client.methods.HttpEntityEnclosingRequestBase)1