initialisePostRequest static method
dynamic
initialisePostRequest({})
Implementation
static initialisePostRequest(
{required Map<String, dynamic> data,
required String url,
token,
apiKey}) async {
try {
var response = await _makePostRequest(
apiUrl: url, data: data, token: token, apiKey: apiKey);
var body = jsonDecode(response.body);
if (_isRequestSuccessful(response.statusCode)) {
return body;
} else {
return _handleError(response);
}
} catch (e) {
print(e.toString());
return e.toString();
}
}