gpt4 book ai didi

http - 如何在Dart中获取域的IP地址?

转载 作者:行者123 更新时间:2023-12-03 04:42:53 24 4
gpt4 key购买 nike

我想创建一个应用程序,该应用程序使用 flutter 获取用户输入的url的IP地址(例如:www.google.com-> 216.58.197.78),遇到了InternetAddress类,但我不知道如何使用它,我是不是我在寻找什么。请帮我解决一下这个 。提前致谢。

最佳答案

使用ipfinder

import 'package:ipfinder/ipfinder.dart';

void main() async {
Ipfinder ipfinder = Ipfinder("YOUR_TOKEN_GOES_HERE");
IpResponse ip = await ipfinder.getAddressInfo("1.0.0.0");
print(ip.toJson()); // print json data
}

关于http - 如何在Dart中获取域的IP地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62860738/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com