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();
}

 

相关文章:

  • 2022-03-05
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
猜你喜欢
  • 2022-12-23
  • 2021-06-22
  • 2021-08-17
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案