HTTP Get请求

1894次阅读  |  发布于5年以前

HTTP Get请求

Use the http package get() function to make a GET request.

import 'package:http/http.dart' as http;

main() async {
  var url = 'http://httpbin.org/';
  var response = await http.get(url);
  print("Response status: ${response.statusCode}");
  print("Response body: ${response.body}");
}

Copyright© 2013-2019

京ICP备2023019179号-2