Skip to content

Instantly share code, notes, and snippets.

@mplacona
Created April 29, 2014 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mplacona/11398906 to your computer and use it in GitHub Desktop.
Save mplacona/11398906 to your computer and use it in GitHub Desktop.
import 'dart:async';
import 'package:http/http.dart' as http;
Future makeRequest(String url) => http.get(url)
.then((res) => res.body);
void main() {
makeRequest('http://www.google.com')
.then((value) => print(value))
.catchError((e) => print(e.toString()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment