短链接变长链接

2021-12-03 00:00:00 链接 变长
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
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。

相关文章