Skip to content

Instantly share code, notes, and snippets.

@r3dm1ke
Created December 16, 2019 19:25
Show Gist options
  • Select an option

  • Save r3dm1ke/7736831ec3456a0e011ec6982dd75462 to your computer and use it in GitHub Desktop.

Select an option

Save r3dm1ke/7736831ec3456a0e011ec6982dd75462 to your computer and use it in GitHub Desktop.
HTTP Get requests in Dart/Flutter
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