原文链接
原文链接
所需jar包
简单Demo
public class MyDemo {
public static void main(String[] args) throws ClientProtocolException, IOException {
//创建HttpClient对象
CloseableHttpClient client = HttpClients.createDefault();
//声明要请求的URl,并且构造HttpGet请求
String url = "https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=18530904740";
HttpGet get = new HttpGet(url);
//让httpGet发送Get请求,得到响应
CloseableHttpResponse response = client.execute(get);
//获取响应信息,并打印到控制台
InputStream is = response.getEntity().getContent();
String msg = IOUtils.toString(is, "GBK");
System.out.println(msg);
}
}
/响应结果
__GetZoneResult_ = {
mts:'1853090',
province:'河南',
catName:'中国联通',
telString:'18530904740',
areaVid:'30500',
ispVid:'137815084',
carrier:'河南联通'
}