bodyAsMap method

Future<Map?> bodyAsMap({
  1. Encoding encoding = conv.utf8,
})

Implementation

Future<Map?> bodyAsMap({conv.Encoding encoding = conv.utf8}) async {
  MimeType mt = mimeType;

  if (mt.isJson) {
    return bodyAsJsonMap(encoding: encoding);
  } else if (mt.isUrlEncodedForm) {
    return bodyAsUrlEncodedForm();
  } else if (mt.isFormData) {
    return _formDataMapToStringMap(await bodyAsFormData());
  }

  return null;
}