Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1113239 of HTTP

  • 版本网址缩略名: Web/HTTP
  • 版本标题: HTTP
  • 版本 id: 1113239
  • 创建于:
  • 创建者: TomasRan
  • 是否是当前版本?
  • 评论
标签: 

修订内容

{{ HTTPSidebar }}

超文本传输协议 (HTTP) 是一种传输如HTML等超媒体文件的应用层协议。起初设计它的目的主要用于Web浏览器与Web服务器之间的通信,当然现在它还可以用做其它遵循客户端-服务端的模型中,客户端打开链接并服务器发送请求,然后等待接收服务器端的响应。HTTP协议也是一个无状态协议,这就意味着服务并不能保留两个请求的之间的数据(状态)。它通常是基于无信息丢失的可靠的TCP/IP传输层协议进行通信的。

教程

通过指南和教程来学习如何使用 HTTP。

HTTP概述
介绍了客户-服务器端协议的基本特征:它能够做什么以及它的设计意图。
HTTP演变
简单描述了HTTP协议从早期版本到现在的HTTP/2以及更新版本的发展过程中所发生的变化。
HTTP消息
描述了HTTP/1.x和HTTP/2.x中不同种类消息的类型和结构。
一个典型的HTTP会话
展现并解释了一个常见的HTTP会话流程。
HTTP/1.x中的连接管理
描述了在HTTP/1.x中的三次连接管理模型,以及它们的优势和劣势。
HTTP Cache
缓存是搭建高性能网站的主要工具。这篇文章阐述了不同种类的缓存以及如何配置HTTP头部来控制它们。
HTTP Cookie
RFC 6265定义了cookies是怎样工作的。 当接收到一个HTTP请求时,服务器会在响应中发送一个 Set-Cookie首部字段。接着,对于同一台服务器发起的每一个请求,客户端都会在HTTP请求头中以字段Cookie的形式将cookie的值发送过去。 此外,还可以指定一个过期时间。 cookie也可以被限制于指定的域名和路径中使用。
HTTP访问控制(CORS)
Cross-site HTTP requests are HTTP requests for resources from a different domain other than the domain of the resource making the request. For instance, a resource loaded from Domain A (https://domaina.example/), such as an HTML web page, makes a request for a resource on Domain B (https://domainb.foo/), such as an image, using the img element (https://domainb.foo/image.jpg). This occurs very commonly on the web today — pages load many resources in a cross-site manner, including CSS stylesheets, images and scripts, and other resources.
控制DNS预读取
Firefox and most other modern browsers perform DNS prefetching. This is when browsers proactively perform domain name resolution on links that the user may choose to follow and resources referenced by the document, such as images, CSS, and JavaScript. This prefetching is performed in the background so that the DNS lookup is likely to have already been resolved by the time the referenced items are requested. This reduces latency when, for example, the user clicks a link.

参考

浏览详细的 HTTP 参考文档。

HTTP头部
HTTP message headers are used to describe precisely the resource or the behavior of the server or the client. Custom proprietary headers can be added using the 'X-' prefix; others in an IANA registry, whose original content was defined in RFC 4229. IANA also maintains a registry of proposed new HTTP message headers.
HTTP请求方法
The different operation that can be done w/ HTTP: {{HTTPMethod("GET")}}, {{HTTPMethod("POST")}}, but also less common requests like {{HTTPMethod("OPTIONS")}}, {{HTTPMethod("DELETE")}} or {{HTTPMethod("TRACE")}}.
HTTP状态返回码
HTTP response codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirections, client errors, and servers errors.

工具与资源

使用和调试你的HTTP连接很有用的工具。

Firefox开发者工具
网络监视器

修订版来源

<div>{{ HTTPSidebar }}</div>

<p class="summary"><strong><dfn>超文本传输协议&nbsp;(HTTP)</dfn></strong>&nbsp;是一种传输如HTML等超媒体文件的应用层协议。起初设计它的目的主要用于Web浏览器与Web服务器之间的通信,当然现在它还可以用做其它遵循<a href="https://en.wikipedia.org/wiki/Client%E2%80%93server_model">客户端-服务端的模型</a>中,客户端打开链接并服务器发送请求,然后等待接收服务器端的响应。HTTP协议也是一个<a href="https://en.wikipedia.org/wiki/Stateless_protocol">无状态协议</a>,这就意味着服务并不能保留两个请求的之间的数据(状态)。它通常是基于无信息丢失的可靠的TCP/IP<a href="https://en.wikipedia.org/wiki/Transport_Layer">传输层</a>协议进行通信的。</p>

<div class="column-container">
<div class="column-half">
<h2 id="教程">教程</h2>

<p>通过指南和教程来学习如何使用 HTTP。</p>

<dl>
 <dt><a href="/zh-CN/docs/Web/HTTP/Overview">HTTP概述</a></dt>
 <dd>介绍了客户-服务器端协议的基本特征:它能够做什么以及它的设计意图。</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP">HTTP演变</a></dt>
 <dd>简单描述了HTTP协议从早期版本到现在的HTTP/2以及更新版本的发展过程中所发生的变化。</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Messages">HTTP消息 </a></dt>
 <dd>描述了HTTP/1.x和HTTP/2.x中不同种类消息的类型和结构。</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Session">一个典型的HTTP会话 </a></dt>
 <dd>展现并解释了一个常见的HTTP会话流程。</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Connection_management_in_HTTP_1.x">HTTP/1.x中的连接管理 </a></dt>
 <dd>描述了在HTTP/1.x中的三次连接管理模型,以及它们的优势和劣势。</dd>
 <dt><a href="/zh-CN/docs/Mozilla/HTTP_cache">HTTP Cache</a></dt>
 <dd>缓存是搭建高性能网站的主要工具。这篇文章阐述了不同种类的缓存以及如何配置HTTP头部来控制它们。</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Cookies">HTTP Cookie</a></dt>
 <dd><a class="external" href="https://tools.ietf.org/html/rfc6265">RFC 6265</a>定义了cookies是怎样工作的。&nbsp;当接收到一个HTTP请求时,服务器会在响应中发送一个 Set-Cookie首部字段。接着,对于同一台服务器发起的每一个请求,客户端都会在HTTP请求头中以字段Cookie的形式将cookie的值发送过去。&nbsp;此外,还可以指定一个过期时间。&nbsp;cookie也可以被限制于指定的域名和路径中使用。</dd>
 <dt><a href="/zh-CN/docs/HTTP/Access_control_CORS">HTTP访问控制(CORS) </a></dt>
 <dd><strong>Cross-site HTTP requests</strong> are HTTP requests for resources from a <strong>different domain</strong>&nbsp;other than the domain of the resource making the request. For instance, a resource loaded from Domain A (<code>https://domaina.example/</code>), such as an HTML web page, makes a request for a resource on Domain B (https://domainb.foo/), such as an image, using the <code>img</code> element (<code>https://domainb.foo/image.jpg</code>). This occurs very commonly on the web today — pages load many resources in a cross-site manner, including CSS stylesheets, images and scripts, and other resources.</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Controlling_DNS_prefetching">控制DNS预读取</a></dt>
 <dd>Firefox and most other modern browsers perform <strong>DNS prefetching</strong>. This is when browsers proactively perform domain name resolution on links that the user may choose to follow and resources referenced by the document, such as images, CSS, and JavaScript. This prefetching is performed in the background so that the DNS lookup is likely to have already been resolved by the time the referenced items are requested. This reduces latency when, for example, the user clicks a link.</dd>
</dl>
</div>

<div class="column-half">
<h2 id="参考">参考</h2>

<p>浏览详细的 HTTP 参考文档。</p>

<dl>
 <dt><a href="/zh-CN/docs/Web/HTTP/Headers">HTTP头部</a></dt>
 <dd>HTTP message headers are used to describe precisely the resource or the behavior of the server or the client. Custom proprietary headers can be added using the 'X-' prefix; others in an <a class="external" href="https://www.iana.org/assignments/message-headers/perm-headers.html">IANA registry</a>, whose original content was defined in <a class="external" href="https://tools.ietf.org/html/rfc4229">RFC 4229</a>. IANA also maintains a <a class="external" href="https://www.iana.org/assignments/message-headers/prov-headers.html">registry of proposed new HTTP message headers</a>.</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Methods">HTTP请求方法 </a></dt>
 <dd>The different operation that can be done w/ HTTP: {{HTTPMethod("GET")}}, {{HTTPMethod("POST")}}, but also less common requests like {{HTTPMethod("OPTIONS")}}, {{HTTPMethod("DELETE")}} or {{HTTPMethod("TRACE")}}.</dd>
 <dt><a href="/zh-CN/docs/Web/HTTP/Response_codes">HTTP状态返回码 </a></dt>
 <dd>HTTP response codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirections, client errors, and servers errors.</dd>
</dl>

<h2 id="工具与资源">工具与资源</h2>

<p>使用和调试你的HTTP连接很有用的工具。</p>

<dl>
 <dt><a href="/zh-CN/docs/Tools">Firefox开发者工具 </a></dt>
 <dd><a href="/zh-CN/docs/Tools/Network_Monitor">网络监视器</a></dd>
</dl>
</div>
</div>
恢复到这个版本