APIRequest constructor

APIRequest(
  1. String method, {
  2. String? methodId,
  3. int settings = APIFlags.waiting,
  4. bool useAuth = false,
  5. Map<String, String> data = const {},
  6. Map<String, String> headers = const {},
  7. APIHttpMethod httpMethod = APIHttpMethod.GET,
})

Creates new request

Implementation

APIRequest(
  this.method, {
  this.methodId,
  this.settings = APIFlags.waiting,
  this.useAuth = false,

  /// JSON body to send
  Map<String, String> data = const {},

  /// Headers to send
  ///
  /// ```
  /// Key: Value
  /// ```
  Map<String, String> headers = const {},
  this.httpMethod = APIHttpMethod.GET,
})  : _completer = Completer(),
      data = Map.from(data),
      headers = Map.from(headers),
      _originalData = data,
      _originalHeaders = headers;