Authorization & Security

void callAsyncherExample(url, data, token) async {
// Fetch all data
List<ExampleData> allData = getAllData();
// Send http request to Asyncher with the data encoded in json
final response = await http.post(
url,
headers: {
'Authorization': 'Bearer ${token}',
'Content-Type': 'application/json'
},
body: jsonEncode(data)
);
// Update database with synchronized data
deleteAllData();
insertAllData(response.body);
}Last updated