decodeBody static method

Future? decodeBody(
  1. HttpRequest request
)

Implementation

static Future<dynamic>? decodeBody(HttpRequest request) async {
  String body = await utf8.decodeStream(request);
  if (request.headers.contentType?.subType == 'json') {
    return jsonDecode(body);
  } else {
    return body;
  }
}