buildCanonicalRequest static method

String buildCanonicalRequest(
  1. String? method,
  2. String path,
  3. Map<String, String>? queryParams,
  4. Map<String, String?> headers,
  5. String payload,
)

Implementation

static String buildCanonicalRequest(
    String? method,
    String path,
    Map<String, String>? queryParams,
    Map<String, String?> headers,
    String payload) {
  final canonicalRequest = [
    method,
    buildCanonicalUri(path),
    buildCanonicalQueryString(queryParams),
    buildCanonicalHeaders(headers),
    buildCanonicalSignedHeaders(headers),
    hexEncode(hash(utf8.encode(payload))),
  ];
  return canonicalRequest.join('\n');
}