Update http_utils.dart

This commit is contained in:
Ankit Mahato
2023-03-23 02:24:53 +05:30
parent cb3865b192
commit dd2ab16f58

View File

@ -87,8 +87,8 @@ String getRequestTitleFromUrl(String? url) {
} }
} }
String? formatBody(String body, MediaType? mediaType){ String? formatBody(String? body, MediaType? mediaType){
if(mediaType != null){ if(mediaType != null && body != null){
var subtype = mediaType.subtype; var subtype = mediaType.subtype;
try { try {
if(subtype.contains(kSubTypeJson)){ if(subtype.contains(kSubTypeJson)){