applyToParams method

  1. @override
void applyToParams(
  1. List<QueryParam> queryParams,
  2. Map<String, dynamic> headerParams
)
override

Apply authentication settings to header and query params.

Implementation

@override
void applyToParams(
    List<QueryParam> queryParams, Map<String, dynamic> headerParams) {
  if (_username != null || _password != null) {
    String str = "${_username ?? ""}:${_password ?? ""}";
    headerParams["Authorization"] =
        "Basic ${base64.encode(utf8.encode(str))}";
  }
}