postRequest method

Future postRequest(
  1. String path,
  2. Map<String, String?> data
)

common POST request call

Implementation

Future<dynamic> postRequest(String path, Map<String, String?> data) async {
  Uri url = Uri.https(AtOnboardingConstants.apiEndPoint, path);

  String body = json.encode(data);
  return _http.post(
    url,
    body: body,
    headers: <String, String>{
      'Authorization': AtOnboardingConstants.apiKey!,
      'Content-Type': 'application/json',
    },
  );
}