applyToParams method
Apply authentication settings to header and query params.
Implementation
@override
void applyToParams(List<MmQueryParam> queryParams, Map<String, String> headerParams) {
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
if (paramValue.isNotEmpty) {
if (location == MmHttpLocation.query) {
queryParams.add(MmQueryParam(paramName, paramValue));
} else if (location == MmHttpLocation.header) {
headerParams[paramName] = paramValue;
} else if (location == MmHttpLocation.cookie) {
headerParams.update(
'Cookie',
(existingCookie) => '$existingCookie; $paramName=$paramValue',
ifAbsent: () => '$paramName=$paramValue',
);
}
}
}