使用用户代理从 https url 下载 Java 仍然返回 403
我尝试从 https URL 下载 gzip 文件,但它返回 403。我发现一些帖子说问题是由于缺少“用户代理”引起的,但它对我不起作用。
I tried to download a gzip file from a https URL, but it returns 403. I find some post said the problem caused by lacking "user-agent", but it didn't work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了两种方法来解决这个问题:
设置cookie
如果您访问的网站需要令牌,请设置基本身份验证
希望它适合您。
I found two ways to solve the problem:
set cookie
set basic auth if the website you access need token
Hope it works for you.