ClientIO constructor

ClientIO({
  1. String endPoint = 'https://cloud.appwrite.io/v1',
  2. bool selfSigned = false,
})

Implementation

ClientIO({
  String endPoint = 'https://cloud.appwrite.io/v1',
  bool selfSigned = false,
}) : _endPoint = endPoint {
  _nativeClient = HttpClient()
    ..badCertificateCallback =
        ((X509Certificate cert, String host, int port) => selfSigned);
  _httpClient = IOClient(_nativeClient);
  _endPoint = endPoint;
  _headers = {
    'content-type': 'application/json',
    'x-sdk-name': 'Dart',
    'x-sdk-platform': 'server',
    'x-sdk-language': 'dart',
    'x-sdk-version': '13.0.0-rc1',
    'user-agent':
        'AppwriteDartSDK/13.0.0-rc1 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
    'X-Appwrite-Response-Format': '1.6.0',
  };

  config = {};

  assert(_endPoint.startsWith(RegExp("http://|https://")),
      "endPoint $_endPoint must start with 'http'");
}