rejectRequest method

Future<void> rejectRequest(
  1. CapabilityLink capabilityLink,
  2. String rejectionReason,
  3. PrivateKey withPrivateKey
)

Implementation

Future<void> rejectRequest(
  CapabilityLink capabilityLink,
  String rejectionReason,
  PrivateKey withPrivateKey,
) async {
  final content = {'rejectionReason': rejectionReason};
  final resp = await postAuth(
    '/request/${capabilityLink.value}/reject',
    json.encode(content),
    withPrivateKey,
  );

  if (resp.statusCode != HttpStatus.ok) {
    return Future.error(HttpResponseError(resp.statusCode, resp.body));
  }
}