ClientIO constructor

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

Implementation

ClientIO({
  String endPoint = 'https://api.tomba.io/v1',
  bool selfSigned = false,
}) : _endPoint = endPoint {
  _nativeClient = new HttpClient()
    ..badCertificateCallback =
        ((X509Certificate cert, String host, int port) => selfSigned);
  _httpClient = new IOClient(_nativeClient);
  this._endPoint = endPoint;
  this._headers = {
    'content-type': 'application/json',
    'x-sdk-version': 'tomba:dart:v1.0.1',
  };

  this.config = {};

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