以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  根据短链接获取长连接  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=191052)

--  作者:lxhmax
--  发布时间:2024/3/23 17:14:00
--  根据短链接获取长连接

  1. 二维码扫出来是一个短链,示例:https://v.douyin.com/eHHc1ft/ ,扫码后并调用本接口可返回当前订单下可用的全部券码信息,如未返回券码信息,则说明该订单此刻无可用券码。
  2. 对短链做 HTTP 请求。得到对应的长链接是https://www.iesdouyin.com/share/commerce/coupon/I0ZwZEZpb2U1N0pjQVZxS2NJRTFSQW5WK1c4bmxvbnNWdUQ2Wk85Y1N0eHpRUFpMMmZwNTdFM2NKeWlFNDM2QT0/?schema_type=13&object_id=I0ZwZEZpb2U1N0pjQVZxS2NJRTFSQW5WK1c4bmxvbnNWdUQ2Wk85Y1N0eHpRUFpMMmZwNTdFM2NKeWlFNDM2QT0&utm_campaign=client_scan_share&app=aweme&utm_medium=ios&tt_from=scan_share&iid=&utm_source=scan_share

老师,访问https://v.douyin.com/eHHc1ft/会跳转到长链接,我应该如何获得这个场链接,下面的代码返回404错误
Dim hc As New HttpClient("https://v.douyin.com/eHHc1ft/")
Dim ret As String = hc.GetData()
Output.Show(ret)

--  作者:有点蓝
--  发布时间:2024/3/23 17:59:00
--  
Dim url As String = "https://v.douyin.com/eHHc1ft/"
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
rqst.AllowAutoRedirect = False
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
output.show(rsps.Headers("Location"))
rsps.Close

--  作者:lxhmax
--  发布时间:2024/3/23 18:10:00
--  
谢谢老师