DioNetKitTransport constructor

DioNetKitTransport({
  1. HttpClientAdapter? httpClientAdapter,
  2. bool browserWithCredentials = false,
})

Creates a transport over a new Dio instance.

httpClientAdapter replaces the platform default adapter, for example to configure a proxy or certificates, or to inject a fake in tests. browserWithCredentials applies to the web adapter only and controls whether cross-site requests carry cookies; keep it false for transports that talk to third-party hosts.

Implementation

DioNetKitTransport({
  HttpClientAdapter? httpClientAdapter,
  bool browserWithCredentials = false,
}) : _dio = _createDio(
        httpClientAdapter ??
            createPlatformAdapter(withCredentials: browserWithCredentials)
                .getAdapter(),
      );