postRealJsonAPI method
Implementation
Future<Map<String, dynamic>> postRealJsonAPI(String url, Map<String, String> headers, Map<String, dynamic> body, {int timeout = 20}) async {
try {
final response = await http.post(Uri.parse(url), headers: headers, body: body).timeout(Duration(seconds: timeout));
return jsonDecode(response.body);
} catch (e) {
return {'error': e.toString()};
}
}