首页 > 其他分享 >IP 解析器

IP 解析器

时间:2022-12-27 19:06:50浏览次数:47  
标签:解析器 5000 http String IP ret ip logger

private static void http(String ip) {
ip = StringUtils.trim(ip);

String url = MessageFormat.format("http://api.ip138.com/query/?ip={0}&token=7bf8b6b142860906263759a0705ec341", ip);

try {

Request request = Request.Get(url);

String ret = request.connectTimeout(5000).socketTimeout(5000).execute().returnContent().asString();

if (StringUtils.contains(ret, "云南")) {

logger.debug(ip);

}



} catch (Exception e) {

logger.error(e.getMessage(), e);

}



}

标签:解析器,5000,http,String,IP,ret,ip,logger
From: https://blog.51cto.com/u_4176761/5973326

相关文章