mirror of
https://github.com/foss42/apidash.git
synced 2025-06-03 00:14:06 +08:00
refactor
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user