sendRequest method
Implementation
Future<CapabilityLink> sendRequest(
Signed<WitnessRequest> witnessRequest,
) async {
final resp = await post('/request', json.encode(witnessRequest.toJson()));
if (resp.statusCode == HttpStatus.accepted) {
return SendRequestResponse.fromJson(json.decode(resp.body))
.capabilityLink;
}
return Future.error(HttpResponseError(resp.statusCode, resp.body));
}