mirror of
https://github.com/foss42/apidash.git
synced 2025-05-24 09:46:45 +08:00
update: removed comments.
This commit is contained in:
@ -88,8 +88,7 @@ echo \$res->getBody();
|
|||||||
m.forEach((key, value) {
|
m.forEach((key, value) {
|
||||||
jsonString += "\t\t\t\t'$key' => '$value',\n";
|
jsonString += "\t\t\t\t'$key' => '$value',\n";
|
||||||
});
|
});
|
||||||
jsonString = jsonString.substring(
|
jsonString = jsonString.substring(0, jsonString.length - 2);
|
||||||
0, jsonString.length - 2); // Removing trailing comma and space
|
|
||||||
result += templateParams.render({
|
result += templateParams.render({
|
||||||
"params": jsonString,
|
"params": jsonString,
|
||||||
});
|
});
|
||||||
@ -114,23 +113,16 @@ echo \$res->getBody();
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (requestModel.hasFormData && !contentTypeAdded) {
|
if (requestModel.hasFormData && !contentTypeAdded) {
|
||||||
// Add Content-Type header for multipart form-data only if it's present and not already added
|
|
||||||
headersString +=
|
headersString +=
|
||||||
"\t\t\t\t'Content-Type' => 'multipart/form-data; boundary=' . \$multipart->getBoundary(), \n";
|
"\t\t\t\t'Content-Type' => 'multipart/form-data; boundary=' . \$multipart->getBoundary(), \n";
|
||||||
}
|
}
|
||||||
headersString = headersString.substring(
|
headersString = headersString.substring(0, headersString.length - 2);
|
||||||
0, headersString.length - 2); // Removing trailing comma and space
|
|
||||||
result += templateHeader.render({
|
result += templateHeader.render({
|
||||||
"headers": headersString,
|
"headers": headersString,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var templateBody = jj.Template(kTemplateBody);
|
var templateBody = jj.Template(kTemplateBody);
|
||||||
// if (requestModel.hasFormData && requestModel.formDataMapList.isNotEmpty) {
|
|
||||||
// result += templateBody.render({
|
|
||||||
// "body": "new MultipartStream(\$multipart)",
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (harJson["postData"]?["text"] != null) {
|
if (harJson["postData"]?["text"] != null) {
|
||||||
result += templateBody
|
result += templateBody
|
||||||
@ -149,7 +141,7 @@ echo \$res->getBody();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""; // Return empty string if postData or formdata is not present
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var templateRequest = jj.Template(kStringRequest);
|
var templateRequest = jj.Template(kStringRequest);
|
||||||
|
Reference in New Issue
Block a user