cleanup ContentType

This commit is contained in:
Ankit Mahato
2024-04-06 13:42:35 +05:30
parent 90eed294e7
commit 631c2e26d3
6 changed files with 8 additions and 8 deletions

View File

@ -90,7 +90,7 @@ axios(config)
m[i["name"]] = i["value"];
}
if (requestModel.hasFormData) {
m[kHeaderContentType] = 'multipart/form-data';
m[kHeaderContentType] = ContentType.formdata.header;
}
result += templateHeader
.render({"headers": padMultilineString(kEncoder.convert(m), 2)});

View File

@ -99,7 +99,7 @@ fetch(url, options)
var m = {};
for (var i in headers) {
// fetch can automatically add the Content-Type header when FormData is passed as body
if (i["name"] == "Content-Type" && requestModel.hasFormData) {
if (i["name"] == kHeaderContentType && requestModel.hasFormData) {
continue;
}
m[i["name"]] = i["value"];