This commit is contained in:
Ashita Prasad
2024-01-07 14:45:18 +05:30
parent 4cf36b6450
commit 462519610a
4 changed files with 13 additions and 13 deletions

View File

@ -136,8 +136,9 @@ Map<String, dynamic> requestModelToHARJsonRequest(
var headers =
useEnabled ? requestModel.enabledHeadersMap : requestModel.headersMap;
if (headers.isNotEmpty || hasBody) {
bool hasContentTypeHeader = headers.keys.any((k) => k.toLowerCase() == HttpHeaders.contentTypeHeader);
bool hasContentTypeHeader = headers.keys
.any((k) => k.toLowerCase() == HttpHeaders.contentTypeHeader);
if (hasBody && !hasContentTypeHeader) {
var m = {
"name": "Content-Type",
@ -157,10 +158,8 @@ Map<String, dynamic> requestModelToHARJsonRequest(
}
}
}
List<FormDataModel> formDataList = requestModel.formDataList ?? [];
if (requestModel.requestBodyContentType == ContentType.formdata) {
var formListMap = rowsToFormDataMap(formDataList);
json["formData"] = formListMap;
if (requestModel.isFormDataRequest) {
json["formData"] = requestModel.formDataMapList;
}
if (exportMode) {
json["comment"] = "";