Skip to content

Instantly share code, notes, and snippets.

@chicho69-cesar
Created December 17, 2022 21:02
Show Gist options
  • Save chicho69-cesar/434b3b48b290b18146e380a118e849aa to your computer and use it in GitHub Desktop.
Save chicho69-cesar/434b3b48b290b18146e380a118e849aa to your computer and use it in GitHub Desktop.
Using Dio package to get the response from an api rest in flutter
import 'package:dio/dio.dart';
Future getHttp() async {
try {
var response = await Dio().get('http://www.google.com');
print(response);
} catch (e) {
print(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment