checkBodyNeedsTobeProcessed function

String checkBodyNeedsTobeProcessed(
  1. String? contentType,
  2. int contentLength,
  3. String? body,
  4. int maxLimit,
)

Implementation

String checkBodyNeedsTobeProcessed(
    String? contentType, int contentLength, String? body, int maxLimit) {
  if ((body != null) &&
      (contentLength > 0 || contentLength == -1) &&
      (contentType!.contains("json") || contentType.contains("text/plain"))) {
    if (contentLength <= maxLimit) {
      return body;
    }
  }
  return "";
}