是“用户代理” HTTPS中的标题强制性根据RFC获取请求
我试图使用MBEDTL从服务器下载文件。 使用以下get请求
get /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx http /1.1
主机:example_xxxxxx.com
连接:保持
使用状态403响应的服务器
服务器在我添加“用户代理”标头时
开始工作。根据RFC规范,使用HTTP的用户代理是强制性的。
I was trying to download a file from a server using mbedtls.
used the following GET request
GET /xxxxxxxxxxxxxxx.xml HTTP/1.1
Host: example_xxxxx.com
Connection: keep-alive
The server responded with status 403
When I add a "User-Agent" header filed, it started working.
Is User-Agent mandatory for HTTP GET requests as per RFC specification.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RFC 2616 14.43:
就RFC而言,这不是必需的。
您正在访问的服务器选择需要用户代理,这可能是某些基本的反剪切机制。
RFC 2616 14.43:
As far as the RFC is concerned, it's not required.
The server you're accessing has chosen to require the user agent, possibly as some rudimentary anti-scraping mechanism.