getContentLength method
Implementation
Future<int?> getContentLength(
dynamic url, {
Map<String, String> headers = const {},
bool validate = true,
}) async {
final response = await head(url, headers: headers);
if (_closed) throw HttpClientClosedException();
if (validate) {
_validateResponse(response, response.statusCode);
}
return int.tryParse(response.headers['content-length'] ?? '');
}