fix(接口测试): 插件录制导入put请求报错

This commit is contained in:
chenjianxing 2020-10-30 14:07:47 +08:00
parent ebc5b50532
commit 5cf7018490
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class MsParser extends ApiImportAbstractParser {
Object body = requestObject.get("body");
if (body instanceof JSONArray) {
JSONArray bodies = requestObject.getJSONArray("body");
if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), "POST") && bodies != null) {
if (bodies != null) {
StringBuilder bodyStr = new StringBuilder();
for (int i = 0; i < bodies.size(); i++) {
String tmp = bodies.getString(i);
@ -74,7 +74,7 @@ public class MsParser extends ApiImportAbstractParser {
}
} else if (body instanceof JSONObject) {
JSONObject bodyObj = requestObject.getJSONObject("body");
if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), "POST") && bodyObj != null) {
if (bodyObj != null) {
JSONArray kvs = new JSONArray();
bodyObj.keySet().forEach(key -> {
JSONObject kv = new JSONObject();