sendHttpRequest static method
Implementation
static Future<Response> sendHttpRequest(RequestType type, String urlString,
Map<String, String> headers, Object data) async {
switch (type) {
case RequestType.Post:
{
print("################# Post: $urlString #####################");
print("################# Body of the post $data #################");
var url = Uri.parse(urlString);
var response = await http.post(url, body: data, headers: headers);
return response;
}
case RequestType.Get:
default:
return Response('error', 0);
}
}