http超文本传输协议_什么是HTTP(超文本传输​​协议)?

http超文本传输协议

http超文本传输协议

Hypertext Transfer Protocol or HTTP is a protocol used to transmit web pages and its contents like HTML, Image, JavaScript, CSS, etc. HTTP is used in a client-server model where the communication is generally started by the client and the server-side response to the client requests.

Hypertext Transfer ProtocolHTTP是用于传输网页及其内容(如HTML,图像,JavaScript,CSS等)的协议。HTTP用于客户端-服务器模型,其中通信通常由客户端和服务器端启动回应客户的要求。

HTTP历史 (HTTP History)

HTTP is created in 1989 by Tim Berners-Lee who was a CERN personnel. The proposed project name was World Wide Web . Word Wide Web is intended to be a computer network and resources which can be shared and used for the whole world.HTTP and HTML were the core protocols for the World Wide Web or simply WWW. HTTP was the transmission protocol of the resources where HTML was the format and protocol of the resources.

HTTP由CERN人员Tim Berners-Lee于1989年创建。 提议的项目名称是World Wide Web 。 Word万维网旨在成为可以在全世界共享和使用的计算机网络和资源。HTTP和HTML是万维网或简称WWW的核心协议。 HTTP是资源的传输协议,而HTML是资源的格式和协议。

The first documented version of the HTTP was 0.9 which is released in 1991. The first major version HTTP 1.0 was released in 1996. The HTTP 1.0 was officially introduced in RFC 1945. This version is rapidly supported by web browsers.

HTTP的第一个文档版本是1991年发布的0.9。1996年发布了第一个主要版本HTTP 1.0。RFC 1945中正式引入了HTTP1.0。Web浏览器Swift支持该版本。

The second version of the HTTP was numbered as HTT1.1 which was providing a lot of updates to version 1.0. HTTP 1.1 is provided as RFC 2068 in 1997. Over time with the need for new implementations in 2014 multiple RFCs like RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235.

HTTP的第二个版本编号为HTT1.1 ,它提供了对1.0版的大量更新。 HTTP 1.1于1997年以RFC 2068的形式提供。随着时间的流逝,随着2014年对新实现的需求,多个RFC(例如RFC 7230,RFC 7231,RFC 7232,RFC 7233,RFC 7234,RFC 7235)得到了满足。

HTTP 2.0 is released in 2015 which was a big change got the HTTP protocol. It is documented with the RFC 7540. Most major browsers added HTTP 2.0 standard in a short time. HTTP 2.0 protocol was mainly based on a Google protocol named SPDY (Speedy).

HTTP 2.0于2015年发布,这是HTTP协议的一个重大变化。 它用RFC 7540记录。大多数主要的浏览器在很短的时间内就添加了HTTP 2.0标准。 HTTP 2.0协议主要基于名为SPDY(Speedy)的Google协议。

Even not officially released yet HTTP 3.0 is almost ready as a draft. HTTP is mainly based UDP protocol which is also called as HTTP over QUIC

甚至尚未正式发布,但HTTP 3.0几乎已经准备就绪。 HTTP主要基于UDP协议,也称为HTTP over QUIC

HTTP术语 (HTTP Terminology)

Before starting to explain the HTTP and how it works let’s provide some terminology and their meanings.

在开始解释HTTP及其工作原理之前,让我们提供一些术语及其含义。

HTML is the resource identification language which is simply text. HTML uses tags that are generally represented visually inside the browsers.

HTML是资源识别语言,仅是文本。 HTML使用通常在浏览器内部以可视方式表示的标签。

Web Browser is a GUI client-side application where the HTTP requests can be initiated by using URLs or web site addresses and the returned HTML response is printed or executed with JavaScript.

Web Browser是GUI客户端应用程序,可以使用URL或网站地址来发起HTTP请求,并使用JavaScript打印或执行返回HTML响应。

LEARN MORE  What is VPN and VPN Tunnel with Free Vpn List?
了解更多什么是带有免费VPN列表的VPN和VPN隧道?

URL is is an addressing scheme where different types of resources can be addressed which is generally a web page, javascript file, image file, etc for the HTTP.

URL是一种寻址方案,可以在其中寻址不同类型的资源,通常是HTTP的网页,javascript文件,图像文件等。

JavaScriptis a dynamic scripting language that is mainly used in client-side and runs for the given web page inside the browser.

JavaScript是一种动态脚本语言,主要在客户端使用,并在浏览器中针对给定的网页运行。

Web Server is the server-side system which provides different web resources according to the client requests. The web server runs daemons in order to respond in a fast way. HTTP is used the communication protocol between the Web Browser and Web Server.

Web Server是服务器端系统,根据客户端请求提供不同的Web资源。 Web服务器运行守护程序以便快速响应。 HTTP用于Web浏览器和Web服务器之间的通信协议。

HTTP如何工作? (How HTTP Works?)

As a client and server protocol HTTP is responsible for the transmission HTML, JavaScript, Image, CSS data by requesting from the Web Server. We can see below a simple HTTP session step by step.

作为客户端和服务器协议,HTTP负责通过Web服务器的请求来传输HTML,JavaScript,Image,CSS数据。 我们可以在下面逐步看到一个简单的HTTP会话。

  • First, the user puts the URL into the address bar of the web browser and push to enter.

    首先,用户将URL放入Web浏览器的地址栏中,然后按进入。
  • HTTP will transfer this request to the webserver.

    HTTP会将此请求传输到Web服务器。
  • The web server will parse the HTTP request and try to fulfill it by providing the requested resources.

    Web服务器将解析HTTP请求,并尝试通过提供请求的资源来实现它。
  • The web server will return HTML, JavaScript, Image, CSS and other resources in the following steps.

    Web服务器将在以下步骤中返回HTML,JavaScript,Image,CSS和其他资源。
  • The web browser will display and executed the returned resources like HTML, JavaScript, Image, CSS, etc.

    Web浏览器将显示并执行返回的资源,例如HTML,JavaScript,Image,CSS等。
How HTTP Works
HTTP如何工作

HTTP请求(HTTP Request )

HTTP communication is initiated with the request. Then the returned response is parsed and according to the content of the response, new requests can be initiated too. Below is an example HTTP request which is made to poftut.com.

HTTP通信随请求启动。 然后,解析返回的响应,并根据响应的内容,也可以发起新的请求。 以下是对poftut.com发出的HTTP请求示例。

GET / HTTP/1.1
Host: www.poftut.com
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
Sec-Fetch-Dest: document
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

GET / HTTP / 1.1 主持人:www.poftut.com 连接:保持活动状态快取控制:max-age = 0 不安全升级请求:1 用户代理:Mozilla / 5.0(Windows NT 10.0; Win64; x64)AppleWebKit / 537.36(KHTML,如Gecko)Chrome / 80.0.3987.149 Safari / 537.36 秒提取目标:文档接受:text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp,image / apng, / ; q = 0.8,application / signed-exchange; v = b3; q = 0.9 安全提取站点:无安全提取模式:导航安全提取用户:?1 接受编码:gzip,deflate,br 接受语言:en-US,en; q = 0.9

LEARN MORE  Understanding and Configuring Apache Access Log
了解更多信息了解和配置Apache访问日志

Lets exaplain this HTTP request.

让我们对此HTTP请求进行说明。

GET / HTTP/1.1 is the HTTP request verb or mehtod which simply says that GET the document located in the / by using HTTP 1.1 protocol.

GET / HTTP/1.1是HTTP请求动词或Mehtod,它简单地表示使用HTTP 1.1协议将GET文档放在/

Host: www.poftut.com is the web site or domain or web server we want to connect which is www.poftut.com

Host: www.poftut.com是我们要连接的网站或域或Web服务器,即www.poftut.com

User-Agent specifies the web browser name and version

User-Agent指定Web浏览器的名称和版本

Accept specifies the resource types the web browser can accept.

Accept指定Web浏览器可以接受的资源类型。

HTTP响应 (HTTP Response)

HTTP Response is the response returned to the client according to its request. HTTP response generally provides some HTML code or Image file or CSS code or JavaScript code.

HTTP Response是根据客户端的请求返回给客户端的响应。 HTTP响应通常提供一些HTML代码或图像文件或CSS代码或JavaScript代码。

HTTP/1.1 200 OK  
Server: nginx/1.14.0 (Ubuntu) 
Date: Sun, 22 Mar 2020 10:17:40 GMT 
Content-Type: text/html; charset=UTF-8 
Transfer-Encoding: chunked 
Connection: keep-alive 
Vary: Accept-Encoding 
X-UA-Compatible: IE=edge 
Link: <https://www.poftut.com/wp-json/>; rel="https://api.w.org/" Content-Encoding: gzip 

HTTP/1.1. 200 OK means the response protocol version is 1.1 and 200 is the HTTP status code for OK request completed successfully.

HTTP/1.1. 200 OK HTTP/1.1. 200 OK表示响应协议版本为1.1,200是OK请求成功完成的HTTP状态代码。

Server is the remote server software name and version with OS name.

Server是远程服务器软件名称和带有操作系统名称的版本。

Data is the date-time when the response is created.

Data是创建响应的日期时间。

Content type is the response content type which is HTML in this case with UTF-8 encoding.

Content type是响应内容类型,在这种情况下为HTML,采用UTF-8编码。

HTTP动词或请求方法 (HTTP Verbs or Request Methods)

HTTP provides some verbs or in other words Request Methods in order, to make HTTP requestion in different styles.

HTTP提供一些动词或换句话说就是Request Methods ,以便以不同的样式发出HTTP请求。

HTTP GET is used to get the representation of the specified resource. GET method simply used to get remote web site content and do not make a change on the remote site.

HTTP GET用于获取指定资源的表示形式。 GET方法仅用于获取远程网站的内容,而不在远程站点上进行更改。

HTTP HEAD is similar to the get but will return only the HTTP Header or information and do not contains a body.

HTTP HEAD与get相似,但将仅返回HTTP Header或信息,并且不包含正文。

HTTP POST is used to send some data into the remote web server where generally client-side user input is sent to the webserver inside the body of the request.

HTTP POST用于将一些数据发送到远程Web服务器,在此通常将客户端用户输入发送到请求主体内的Web服务器。

HTTP PUT is a method is used to put the information into the remote web server. The information is provided via the URI or URL, not with the body.

HTTP PUT是一种用于将信息放入远程Web服务器的方法。 该信息是通过URI或URL提供的,而不是通过正文提供的。

LEARN MORE  How To Redirect Http To Https In Apache and Nginx
了解更多信息如何在Apache和Nginx中将Http重定向到Https

HTTP DELETE will delete specified remote resources that are generally not used during a web experience for end-user.

HTTP DELETE将删除最终用户在网络体验期间通常不使用的指定远程资源。

HTTP TRACE will track changes between intermediate servers. This method is not popular too.

HTTP TRACE将跟踪中间服务器之间的更改。 这种方法也不受欢迎。

HTTP OPTIONS will return the remote server supported methods.

HTTP OPTIONS将返回远程服务器支持的方法。

HTTP CONNECT will is generally used to connect proxy servers and create an HTTP tunnel.

HTTP CONNECT通常用于连接代理服务器并创建HTTP隧道。

HTTP PATCH is used to patch or modify partially the remote resource which is not popular too.

HTTP PATCH用于修补或修改也不受欢迎的远程资源。

HTTP状态码 (HTTP Status Codes)

Every HTTP request is returned with a code which is called HTTP Status Code . This status code specifies the completion status of the request like successful, failed, server error, etc.

每个HTTP请求都返回一个称为HTTP Status Code 。 此状态码指定请求的完成状态,例如成功,失败,服务器错误等。

Informational 1XX status codes like 101, 102 is used to provide some information about the request to the client.

信息性1XX状态代码(如101、102)用于向客户端提供有关请求的某些信息。

Successful 2XX status codes like 200, 202 are used to provide that the request is successfully completed.

Successful 2XX状态代码(例如200、202)用于提供请求已成功完成的信息。

Redirection 3XX status codes like 300, 302 are used to redirect the client to different URI or address.

Redirection 3XX状态码(如Redirection 3XX用于将客户端重定向到其他URI或地址。

Client Error 4XX status codes like 400, 404 are used to inform the client that there is an error related to the request.

Client Error 4XX状态码(例如Client Error 4XX用于通知客户端存在与请求有关的错误。

Server Error 5XX status codes like 503 are used to inform the client that there is a server related error that prevents the request to be completed.

Server Error 5XX状态代码(如503)用于通知客户端存在与服务器相关的错误,阻止了请求的完成。

安全的HTTP或HTTPS (Secure HTTP or HTTPS)

The HTTP protocol is created as a clear text protocol where there is no security in mind. But with the increasing cybersecurity threads the HTTP protocol became very vulnerable. The SSL/TLS tunneling is created for HTTP traffic to encrypt traffic. HTTP with SSL/TLS is called HTTPS simply secure HTTP. Event a regular HTTP traffic can be eavesdropped and read easily HTTPS traffic can be read in a meaningful way to get information about the traffic.

HTTP协议是作为纯文本协议创建的,此处没有考虑安全性。 但是随着网络安全线程的增加,HTTP协议变得非常脆弱。 为HTTP通信创建SSL / TLS隧道以加密通信。 带有SSL / TLS的HTTP称为HTTPS,简称为安全HTTP。 如果可以窃听常规HTTP流量并轻松读取,则可以以有意义的方式读取HTTPS流量以获取有关流量的信息。

翻译自: https://www.poftut.com/what-is-http-hypertext-transfer-protocol/

http超文本传输协议

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值