diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java index 914ef1eef0..0ce4456848 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java @@ -137,7 +137,7 @@ public class MsJmeterParser extends ApiImportAbstractParser { HTTPSamplerProxy source = (HTTPSamplerProxy) key; BeanUtils.copyBean(samplerProxy, source); if (source != null && source.getHTTPFiles().length > 0) { - samplerProxy.getBody().setBinary(new ArrayList<>()); + samplerProxy.getBody().initBinary(); samplerProxy.getBody().setType(Body.FORM_DATA); List keyValues = new LinkedList<>(); for (HTTPFileArg arg : source.getHTTPFiles()) { @@ -153,7 +153,12 @@ public class MsJmeterParser extends ApiImportAbstractParser { keyValue.setFiles(files); keyValues.add(keyValue); } - samplerProxy.getBody().setKvs(keyValues); + if (source.getPostBodyRaw() && CollectionUtils.isNotEmpty(keyValues)) { + samplerProxy.getBody().setType(Body.RAW); + samplerProxy.getBody().setRaw(keyValues.get(0).getValue()); + } else { + samplerProxy.getBody().setKvs(keyValues); + } } samplerProxy.setProtocol(RequestType.HTTP); samplerProxy.setPort(source.getPort() + ""); @@ -173,6 +178,7 @@ public class MsJmeterParser extends ApiImportAbstractParser { samplerProxy.setArguments(keyValues); } } + samplerProxy.getBody().initBinary(); } samplerProxy.setPath(""); samplerProxy.setMethod(source.getMethod()); diff --git a/backend/src/main/java/io/metersphere/api/dto/scenario/Body.java b/backend/src/main/java/io/metersphere/api/dto/scenario/Body.java index f3f484b747..cabfccc0c4 100644 --- a/backend/src/main/java/io/metersphere/api/dto/scenario/Body.java +++ b/backend/src/main/java/io/metersphere/api/dto/scenario/Body.java @@ -74,6 +74,7 @@ public class Body { } } KeyValue keyValue = new KeyValue("", "JSON-SCHEMA", this.getRaw(), true, true); + sampler.setPostBodyRaw(true); keyValue.setEnable(true); keyValue.setEncode(false); body.add(keyValue); diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 2115bd28a9..07951ba17a 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 2115bd28a90854d2b6276a90878934715498c584 +Subproject commit 07951ba17aef6f29e50cfd68e40de3266f9a60cd