get method
Implementation
Future<Map<String, dynamic>> get(String url) async {
// Await the http get response, then decode the json-formatted response.
var response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
var jsonResponse = json.decode(response.body);
print('Response: $jsonResponse.');
return jsonResponse;
} else {
print('Request failed with status: ${response.statusCode}.');
return Map();
}
}