This commit is contained in:
Ashita Prasad
2024-12-06 05:00:14 +05:30
parent f63663392c
commit ce2213ce7b
2 changed files with 8 additions and 10 deletions

View File

@ -6,8 +6,14 @@ ContentType? getContentTypeFromHeadersMap(
Map<String, String>? kvMap,
) {
if (kvMap != null && kvMap.hasKeyContentType()) {
var val = kvMap.getValueContentType();
var val = getMediaTypeFromHeaders(kvMap);
if (val != null) {
if (val.subtype.contains(kSubTypeJson)) {
return ContentType.json;
} else if (val.type == kTypeMultipart &&
val.subtype == kSubTypeFormData) {
return ContentType.formdata;
}
return ContentType.text;
}
}