diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java index 0e90b74690..ed7bcc604b 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java @@ -103,6 +103,7 @@ public class MockApiUtils { } else if (StringUtils.equalsIgnoreCase(type, "XML")) { if (bodyObj.has("raw")) { String xmlStr = bodyObj.optString("raw"); + xmlStr = xmlStr.replaceAll("\r","").replaceAll("\n",""); JSONObject matchObj = XMLUtil.xmlStringToJSONObject(xmlStr); returnJson = matchObj; }