Flutter - 使用网络请求

2019-10-04  本文已影响0人  yytester
import 'package:dio/dio.dart';
void getHttp() async {
  try {
    Response response = await Dio().get("https://www.baidu.com");
    print(response);

    print("-------------");
    print(response.data.toString());
  } catch (e) {
    print(e);
  }
}

void main(List<String> args) {
   getHttp();
}


上一篇 下一篇

猜你喜欢

热点阅读