send method
Future<PactSendResponse>
send({
- required String host,
- required PactSendRequest commands,
override
Implementation
@override
Future<PactSendResponse> send({
required String host,
required PactSendRequest commands,
}) async {
http.Response response = await http.post(
Uri.parse(
'$host/send',
),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: commands.toJson(),
);
try {
return PactSendResponse.fromJson(
jsonDecode(
response.body,
),
);
} catch (e) {
throw PactApiError(
error: response.body,
);
}
}