Curl constructor
Curl({})
Constructs a new Curl object with the specified parameters.
The uri
parameter is required, while the remaining parameters are optional.
Implementation
Curl({
required this.uri,
this.method = 'GET',
this.headers,
this.data,
this.cookie,
this.user,
this.referer,
this.userAgent,
this.formData,
this.form = false,
this.insecure = false,
this.location = false,
}) {
assert(
['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'].contains(method));
assert(['http', 'https'].contains(uri.scheme));
assert(form ? formData != null : formData == null);
}