setAuthorization method

void setAuthorization(
  1. String authorization, {
  2. bool addBearer = true,
})

设置授权(Token) 默认在开头添加Bearer authorization 授权Token

Implementation

void setAuthorization(String authorization, {bool addBearer = true}) {
  if (addBearer) {
    _authorization = 'Bearer $authorization';
  } else {
    _authorization = authorization;
  }
}