提交 0fd89fc6 编写于 作者: C chenjianxing

refactor: post请求url优化

上级 3841ff55
......@@ -663,11 +663,19 @@ class JMXHttpRequest {
getPostQueryParameters(request, path) {
if (this.method.toUpperCase() !== "GET") {
path += '?';
let parameters = [];
request.parameters.forEach(parameter => {
if (parameter.name) {
path += ((parameter.name) + '=' + (parameter.value) + '&');
if (parameter.name && parameter.value) {
parameters.push(parameter);
}
});
for (let i = 0; i < parameters.length; i++) {
let parameter = parameters[i];
path += (encodeURIComponent(parameter.name) + '=' + encodeURIComponent(parameter.value));
if (i != parameters.length -1) {
path += '&';
}
}
}
return path;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册