fix (接口测试): 修复请求头中包含多余参数
--bug=1008180 --user=赵勇 【github #7881】HTTP请求默认添加了"content-type":"text/plain; charset=UTF-8"的请求头 https://www.tapd.cn/55049933/s/1071783
This commit is contained in:
parent
93a89f32e7
commit
a3ef283488
|
@ -237,7 +237,10 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
sampler.setDoMultipart(true);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(bodyParams)) {
|
||||
sampler.setArguments(httpArguments(bodyParams));
|
||||
Arguments arguments = httpArguments(bodyParams);
|
||||
if (arguments != null && !arguments.getArguments().isEmpty()) {
|
||||
sampler.setArguments(arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ public class Body {
|
|||
sampler.setDoMultipart(true);
|
||||
}
|
||||
} else {
|
||||
if(StringUtils.isNotEmpty(this.getRaw()) || this.getJsonSchema()!= null ) {
|
||||
parseJonBodyMock();
|
||||
KeyValue keyValue = new KeyValue("", "JSON-SCHEMA", this.getRaw(), true, true);
|
||||
sampler.setPostBodyRaw(true);
|
||||
|
@ -78,6 +79,7 @@ public class Body {
|
|||
keyValue.setUrlEncode(false);
|
||||
body.add(keyValue);
|
||||
}
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue