local method
Future<PactResponse>
local({
- required String host,
- required PactCommand command,
- bool preflight = true,
- bool signatureValidation = true,
override
Implementation
@override
Future<PactResponse> local({
required String host,
required PactCommand command,
bool preflight = true,
bool signatureValidation = true,
}) async {
http.Response response = await http.post(
Uri.parse(
'$host/local?preflight=$preflight&signatureValidation=$signatureValidation',
),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: command.toJson(),
);
try {
return PactResponse.fromJson(
jsonDecode(
response.body,
),
);
} catch (e) {
throw PactApiError(
error: response.body,
);
}
}