private static void http(String ip) {标签:解析器,5000,http,String,IP,ret,ip,logger From: https://blog.51cto.com/u_4176761/5973326
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);
}
}