CloudBaseRequest constructor

CloudBaseRequest(
  1. CloudBaseCore _core
)

CloudBaseRequest 初始化

Implementation

CloudBaseRequest(this._core) {
  Duration timeout = _core.config.timeout != null
      ? Duration(milliseconds: _core.config.timeout!)
      : Duration(milliseconds: _TCB_DEFAULT_TIMEOUT);
  // int? timeout = _core.config.timeout != null
  //     ? _core.config.timeout
  //     : _TCB_DEFAULT_TIMEOUT;
  _dio = Dio(BaseOptions(
      headers: {
        'Connection': 'Keep-Alive',
        'User-Agent': 'cloudbase-flutter-sdk/0.0.2',
        'X-SDK-Version': 'cloudbase-flutter-sdk/0.0.2'
      },
      contentType: 'application/json',
      responseType: ResponseType.json,
      queryParameters: {'env': _core.config.envId},
      sendTimeout: timeout));
}