Created
December 16, 2019 19:25
-
-
Save r3dm1ke/7736831ec3456a0e011ec6982dd75462 to your computer and use it in GitHub Desktop.
HTTP Get requests in Dart/Flutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:http/http.dart' as http; | |
| // Sending a GET request | |
| const url = 'http://some-api.com/users'; | |
| const response = await http.get(url); | |
| print(response.body); | |
| // Sending a GET request using .read | |
| const data = await http.read(url); | |
| print(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment