putOnDB function
Generic Put function to make Put API calls
Implementation
Future<Map> putOnDB(
{required String api, required String apiKey, required Map body}) async {
final http.Response response = await http.put(Uri.parse(api),
headers: <String, String>{
'Content-Type': 'application/json',
'X-CC-Version': '2018-03-22',
'X-CC-Api-Key': apiKey,
},
body: jsonEncode(body));
return jsonDecode(response.body);
}