requestCode method

Future<Request> requestCode(
  1. String? codeMethod,
  2. String? language
)

Implementation

Future<Request> requestCode(String? codeMethod, String? language) async {
  final Map<String, String> headers = {
    'Authorization': 'Bearer $accessToken',
  };

  codeMethod ??= 'SMS';
  language ??= 'en';

  final Map<String, String> body = {
    'code_method': codeMethod,
    'language': language,
  };

  await request.postForm('$fromNumberId/request_code', headers, body);
  return request;
}