public static void main(String[] args) { String result = ""; BufferedReader in = null; String s = "https://restapi.amap.com/v3/assistant/coordinate/convert?locations=lnt,lat&coordsys=gps&output=json&key="; try { URL realUrl = new URL(s); // 打开和URL之间的连接 URLConnection connection = realUrl.openConnection(); // 设置通用的请求属性 connection.setRequestProperty("accept", "*/*"); connection.setRequestProperty("connection", "Keep-Alive"); connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); // 建立实际的连接 connection.connect(); // 获取所有响应头字段 Map<String, List<String>> map = connection.getHeaderFields(); // 遍历所有的响应头字段 for (String key : map.keySet()) { System.out.println(key + "
通过给定gps调用高德api获得高德经纬度
最新推荐文章于 2024-05-12 18:34:47 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)