在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
import 'dart:convert'; import 'dart:html'; void main() { _getIPAddress() { final url = 'https://httpbin.org/ip'; HttpRequest.request(url).then((value) { print(json.decode(value.responseText)['origin']); }).catchError((error) => print(error)); } _getIPAddress(); } 114.92.6.153, 114.92.6.153 async import 'dart:convert'; import 'dart:html'; void main() { _getIPAddress() async { final url = 'https://httpbin.org/ip'; var request = await HttpRequest.request(url); String ip = json.decode(request.responseText)['origin']; print(ip); } _getIPAddress(); }
|
请发表评论