post method
POST Request
Implementation
Future<dynamic> post(String model, String body,
{Map<String, String>? customHeaders,
String pageId = "1",
String pageSize = "0",
String contentType = "application/json"}) async {
http.Response response;
try {
response = await client.post(
generateEndpointUrl(model),
headers: generateHeader(
customHeaders: customHeaders,
pageId: pageId,
pageSize: pageSize,
contentType: contentType),
body: body,
);
} catch (e) {
throw Exception("Unable to make POST request. ${e.toString()}");
}
return response;
}