修复乱码

This commit is contained in:
q4speed 2020-05-26 12:59:13 +08:00
parent 0433d8f36b
commit adb7dc2728
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import org.apache.jmeter.visualizers.backend.AbstractBackendListenerClient;
import org.apache.jmeter.visualizers.backend.BackendListenerContext;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.*;
/**
@ -122,7 +123,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
requestResult.setError(result.getErrorCount());
ResponseResult responseResult = requestResult.getResponseResult();
responseResult.setBody(result.getResponseDataAsString());
responseResult.setBody(new String(result.getResponseData(), StandardCharsets.UTF_8));
responseResult.setHeaders(result.getResponseHeaders());
responseResult.setLatency(result.getLatency());
responseResult.setResponseCode(result.getResponseCode());