post method
Build and execute a post request to bagelDB. item
should follow the collection schema as defined at app.bageldb.com
Implementation
Future<BagelResponse> post(Map<String, dynamic> item) async {
String url = '$baseEndpoint/collection/$collectionID/items';
if (nestedCollectionsIDs.isNotEmpty) {
String nestedID = nestedCollectionsIDs.join(".");
url = '$url/$_item?nestedID=$nestedID';
}
Dio dio = await _dio();
return dio.post(url, data: item).then((Response res) async {
return BagelResponse(data: res.data, statusCode: res.statusCode!);
});
}