HTTP/1.1:消息语法与路由 - 2.2 实现差异

2016-11-08  本文已影响0人  yangxg

When considering the design of HTTP, it is easy to fall into a trap of thinking that all user agents are general-purpose browsers and all origin servers are large public websites. That is not the case in practice. Common HTTP user agents include household appliances, stereos, scales, firmware update scripts, command-line programs, mobile apps, and communication devices in a multitude of shapes and sizes. Likewise, common HTTP origin servers include home automation units, configurable networking components, office machines, autonomous robots, news feeds, traffic cameras, ad selectors, and video-delivery platforms.

在考虑 HTTP 的设计时,很容易掉进一个思维陷阱:所有用户代理(user agent)都是通用浏览器和所有原始服务器是大型公用网站。这样是不切实际的。常见的 HTTP 用户代理包含各种形状和尺寸的家用设备,固件更新脚本,命令行程序,手机应用程序,和通信设备。同样,常见的 HTTP 来源服务器包含家庭自动化单元,可配置的网络组件,办公设备,独立存在的机器人,新闻提要,交通摄像机,广告选择器,和视频分发平台。

The term "user agent" does not imply that there is a human user directly interacting with the software agent at the time of a request. In many cases, a user agent is installed or configured to run in the background and save its results for later inspection (or save only a subset of those results that might be interesting or erroneous). Spiders, for example, are typically given a start URI and configured to follow certain behavior while crawling the Web as a hypertext graph.

术语 “用户代理” 不意味着在发起请求时是由真人用户直接交互软件代理。在许多案例中,用户代理是安装好或配置好的在后台运行或保存结果将来检查(或只保存这些结果中他们可能感兴趣的子集或错误信息)。例如爬虫,是典型的使用 URL 和经过配置遵循某种行为的抓取网站超文本信息程序。

The implementation diversity of HTTP means that not all user agents can make interactive suggestions to their user or provide adequate warning for security or privacy concerns. In the few cases where this specification requires reporting of errors to the user, it is acceptable for such reporting to only be observable in an error console or log file. Likewise, requirements that an automated action be confirmed by the user before proceeding might be met via advance configuration choices, run-time options, or simple avoidance of the unsafe action; confirmation does not imply any specific user interface or interruption of normal processing if the user has already made that choice.

HTTP 的实现差异意味着不是所有用户代理可以与它们的用户交互反馈或为安全或隐私问题提供充分警告。在少数案例本规范要求对用户报告错误,它可以接收这样的错误报告只在错误控制台或日志文件查看。同样,自动化操作之前需要让用户确认,通过先进的配置选择,运行时选项,或简单的避免不安全操作;确认操作不意味着任何特定用户接口或用户做出选择后中断正常处理。

上一篇下一篇

猜你喜欢

热点阅读