Skip to content

Instantly share code, notes, and snippets.

@Zambrella
Last active September 22, 2019 20:46
Show Gist options
  • Save Zambrella/1c7dc847afd58618682bd65ccb97c378 to your computer and use it in GitHub Desktop.
Save Zambrella/1c7dc847afd58618682bd65ccb97c378 to your computer and use it in GitHub Desktop.
Getting the response from an API call
import 'constants.dart';
import 'package:http/http.dart' as http;
const String kURL = 'https://api.opendota.com/api/distributions/';
class Brain {
Future<dynamic> getCumulativeCount() async {
http.Response response = await http.get('$kURL?apikey=$kAPIKey');
print(response.body);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment