signAndSend method

Future<Map<String, dynamic>> signAndSend(
  1. String method,
  2. String path, {
  3. required String bearerToken,
  4. required InstallationIdentity identity,
  5. Map<String, dynamic>? body,
  6. String? installationId,
})

Signs and sends one request under bearerToken, its body as JSON. installationId replaces the installation the proof names, only to test that a backend refuses it.

Implementation

Future<Map<String, dynamic>> signAndSend(
  String method,
  String path, {
  required String bearerToken,
  required InstallationIdentity identity,
  Map<String, dynamic>? body,
  String? installationId,
}) async {
  return sendSigned(
    await signRequest(
      identity: identity,
      method: method,
      path: path,
      bearerToken: bearerToken,
      encodedBody: jsonEncode(body ?? <String, dynamic>{}),
      installationId: installationId,
    ),
  );
}