createProperty method
Define the construction of AsserestProperty
with given url
, timeout
,
accessible
and tryCount
with additionalProperty
for those
non-standard properties found in Map.
Implementation
@override
AsserestHttpProperty createProperty(
Uri url,
Duration timeout,
bool accessible,
int? tryCount,
UnmodifiableMapView<String, dynamic> additionalProperty) {
final HttpRequestMethod method = HttpRequestMethod.values
.singleWhere((e) => e.name == additionalProperty["method"]);
final Map<String, String>? headers = additionalProperty["header"];
final Object? body = additionalProperty["body"];
return AsserestHttpProperty(
url,
accessible,
timeout,
tryCount,
method,
UnmodifiableMapView({
"User-Agent":
"Asserest $_uaVersion (${platform_iden.runtimePlatformInString})"
}..addAll(headers ?? <String, String>{})),
body);
}