短链接变长链接

public void Test() throws IOException {
   HttpURLConnection conn = (HttpURLConnection) new java.net.URL("https://v.douyin.com/NBnULu2")
         .openConnection();
   conn.setInstanceFollowRedirects(false);
   conn.setConnectTimeout(5000);
   String url = conn.getHeaderField("Location");
   
   System.out.println(url);
}

    原文作者:itke
    原文地址: https://blog.csdn.net/weixin_43155696/article/details/123807239
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞