init method

dynamic init()

构造

Implementation

init() {
  print('YmHttp init~');
  _dio = new Dio();

  //请求header的配置
  _dio.options.headers = {};

  _dio.options.connectTimeout = 10000;
  _dio.options.receiveTimeout = 10000;

  _dio.interceptors.add(LogInterceptor(responseBody: false)); //是否开启请求日志
  _dio.interceptors.add(CookieManager(CookieJar())); //缓存相关类
}