post method
Method to make post request. It's called from rust
Implementation
Future<String> post(String requestData) async {
try {
String endpoint;
if (settings.endpoints.length == 1) {
endpoint = settings.endpoints.first;
} else {
endpoint = await _getEndpoint();
}
return await _post(
endpoint: endpoint,
headers: {
'Content-Type': 'application/json',
},
data: requestData,
);
} catch (error) {
throw ErrorCode.Network;
}
}