maybeUpdateUsedWeight method
Will check response's headers to update the current requests quota.
Implementation
@visibleForTesting
void maybeUpdateUsedWeight(Map<String, String> headers) {
if (headers.containsKey(xMbxUsedWeightHeader)) {
final weightAsString = headers[xMbxUsedWeightHeader]!;
try {
_usedWeight = int.parse(weightAsString);
_log('updated used weight : $_usedWeight');
} catch (e) {
_log('unexpected format for weight $weightAsString');
}
} else {
_log('used weight header not found');
}
}