imroc / req

Simple Go HTTP client with Black Magic
https://req.cool
MIT License
4.25k stars 347 forks source link

怎么获得待跳转的URL #264

Closed Xwudao closed 1 year ago

Xwudao commented 1 year ago

相关issue: https://github.com/imroc/req/issues/219

但是上面的解决办法是会访问到跳转后的地址,

我的目的是不访问,仅仅获取将要跳转的地址

imroc commented 1 year ago

禁止跳转然后获取header中的Location就行

client.SetRedirectPolicy(req.NoRedirectPolicy())

Xwudao commented 1 year ago

禁止跳转然后获取header中的Location就行

client.SetRedirectPolicy(req.NoRedirectPolicy())

多谢!