bodyIsNonEmpty static method

bool bodyIsNonEmpty(
  1. dynamic body
)

True se il body va incluso nel curl.

Implementation

static bool bodyIsNonEmpty(dynamic body) {
  if (body == null) {
    return false;
  }
  if (body is String) {
    return body.isNotEmpty;
  }
  if (body is Map) {
    return body.isNotEmpty;
  }
  if (body is List) {
    return body.isNotEmpty;
  }
  if (body is FormData) {
    return body.fields.isNotEmpty || body.files.isNotEmpty;
  }
  return true;
}