Closed Aoi-hosizora closed 3 years ago
Done
var h = (headers ?? {})..['Accept-Encoding'] = '';
int totalSize;
http.head(url, headers: {
'Accept': '*/*',
...h,
}).then((data) {
totalSize = int.tryParse(data.headers['content-length']);
}).catchError((_) {});
The
http.head
header should contain theheaders
parameter.