1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 获取快递物流信息(快递100)

获取快递物流信息(快递100)

时间:2021-12-24 01:40:08

相关推荐

获取快递物流信息(快递100)

废话不多说,上代码!!亲测有效!

import .*;import java.io.*;public class ExpressQuery {public static void main(String[] args) {try {String url = "/query?type=快递公司代号&postid=快递单号";URL obj = new URL(url);HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("GET");BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) {response.append(inputLine);}in.close();System.out.println(response.toString());} catch (Exception e) {System.out.println(e);}}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。