generateHeaders method

Future<Map<String, String>> generateHeaders(
  1. String payload
)

Generate the headers for the request.

Implementation

Future<Map<String, String>> generateHeaders(String payload) async {
  final now = DateTime.now();
  final headers = <String, String>{
    ...easySmsDefaultHeaders,
    'Host': _endpoint.host,
    'X-TC-Action': 'SendSms',
    'X-TC-Version': '2021-01-11',
    'X-TC-Region': region,
    'X-TC-Timestamp': generateTimestamp(now),
    'X-TC-Language': language.value,
  };

  return {
    ...headers,
    'Authorization': generateAuthorization(headers, payload, now),
  };
}