AsserestHttpProperty constructor

AsserestHttpProperty(
  1. Uri url,
  2. bool accessible,
  3. Duration timeout,
  4. int? tryCount,
  5. HttpRequestMethod method,
  6. Map<String, String>? headers,
  7. Object? body,
)

Implementation

AsserestHttpProperty(this.url, this.accessible, this.timeout, this.tryCount,
    this.method, Map<String, String>? headers, this.body)
    : this.headers =
          UnmodifiableMapView(headers ?? const <String, String>{}) {
  if (body != null && body is! Map && body is! List && body is! String) {
    throw InvalidBodyTypeError._(body.runtimeType);
  } else if (method.bodyRequired && body == null) {
    throw NonNullBodyRequiredException._(method, body);
  }
}