Table of Contents
为你详细解读HTTP请求头的具体含意,解读请求含意
Home Backend Development PHP Tutorial 为你详细解读HTTP请求头的具体含意,解读请求含意_PHP教程

为你详细解读HTTP请求头的具体含意,解读请求含意_PHP教程

Jul 12, 2016 am 09:05 AM
http specific meaning us beat of Interpretation detailed ask

为你详细解读HTTP请求头的具体含意,解读请求含意

当我们打开一个网页时,浏览器要向网站服务器发送一个HTTP请求头,然后网站服务器根据HTTP请求头的内容生成当次请求的内容发送给浏览器。你明白HTTP请求头的具体含意吗?下面一条条的为你详细解读,先看某一次HTTP请求头的具体内容:

  Accept-Language: zh-cn,zh;q=0.5
  Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Encoding: gzip, deflate
  User-Agent: Mozilla/5.0 (compatible; 域名)
  Host: 域名
  Connection: Keep-Alive

 下面根据以上HTTP请求内容的先后顺序一条条的解读:

 

  1. Accept-Language: zh-cn,zh;q=0.5

      意思:浏览器支持的语言分别是中文和简体中文,优先支持简体中文。

      详解:

      Accept-Language表示浏览器所支持的语言类型;

      zh-cn表示简体中文;zh 表示中文;

      q是权重系数,范围 0 =

     

  2.   Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7

      意思:浏览器支持的字符编码分别是 GB2312、utf-8 和任意字符,优先顺序是 GB2312、utf-8、*。

      详解:

      Accept-Charset告诉 Web 服务器,浏览器可以接受哪些字符编码;

      GB2312是中国国家标准简体中文字符集,全称《信息交换用汉字编码字符集·基本集》,又称GB0,由中国国家标准总局发布,1981年5月1日实施。GB2312 编码通行于中国大陆;新加坡等地也采用此编码。

      utf-8是 Unicode 的一种变长字符编码又称万国码,由 Ken Thompson 于1992年创建,现在已经标准化为 RFC 3629。

      *表示任意字符编码,虽然 q 都是等于 0.7,但明确指定的 GB2312,utf-8 比 * 具有更高的优先级。

     

  3.   Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

      意思:浏览器支持的 MIME 类型分别是 text/html、application/xhtml+xml、application/xml 和 */*,优先顺序是它们从左到右的排列顺序。

      详解:

      Accept表示浏览器支持的 MIME 类型;

      MIME的英文全称是 Multipurpose Internet Mail Extensions(多功能 Internet 邮件扩充服务),它是一种多用途网际邮件扩充协议,在1992年最早应用于电子邮件系统,但后来也应用到浏览器。

      text/html,application/xhtml+xml,application/xml 都是 MIME 类型,也可以称为媒体类型和内容类型,斜杠前面的是 type(类型),斜杠后面的是 subtype(子类型);type 指定大的范围,subtype 是 type 中范围更明确的类型,即大类中的小类。

      Text:用于标准化地表示的文本信息,文本消息可以是多种字符集和或者多种格式的;

      text/html表示 html 文档;

      Application:用于传输应用程序数据或者二进制数据;

      application/xhtml+xml表示 xhtml 文档;

      application/xml表示 xml 文档。

     

  4.   Accept-Encoding: gzip, deflate

      意思:浏览器支持的压缩编码是 gzip 和 deflate。

      详解:

      Accept-Encoding表示浏览器有能力解码的编码类型;

      gzip是 GNU zip 的缩写,它是一个 GNU 自由软件的文件压缩程序,也经常用来表示 gzip 这种文件格式。

      deflate是同时使用了 LZ77 算法与哈夫曼编码(Huffman Coding)的一个无损数据压缩算法。

       User-Agent: Mozilla/5.0 (compatible;域名)

      

  5. 意思:使用的用户代理是 Mozilla/5.0 (compatible; 域名)。

      详解:

      User-Agent(用户代理),简称 UA,它是一个特殊字符串头,使得服务器能够识别客户端使用的操作系统及版本、CPU 类型、浏览器及版本、浏览器渲染引擎、浏览器语言、浏览器插件等。

      Mozilla/5.0:Mozilla 是浏览器名,版本是 5.0;

      compatible(兼容的)表示平台是兼容模式;

     

  6.   Host: 域名

      Host表示请求的服务器网址;

     

  7.   Connection: Keep-Alive

      Connection表示客户端与服务连接类型;

      Keep-Alive表示持久连接;

     

     

    请求头
    Accept:客户机通过这个头,告诉服务器,它支持哪些数据类型
    Accept-Charset::客户机通过这个头,告诉服务器,它支持的编码
    Accept-Encoding: 客户机通过这个头,告诉服务器,支持哪种数据压缩格式
    Accept-Language: 客户机采用的是哪个语言
    Host:客户机通过这个头,告诉服务器,想访问服务器哪台主机
    If-Modified-Since:客户机通过这个头,告诉服务器,数据缓存的时间
    Referer:客户机通过这个头,告诉服务器,客户机是从哪个页面来的(防盗链)
    User-Agent: 说明客户机操作系统信息,以及浏览器信息
    Cookie:客户机通过这个头,可以带点数据给服务器
    Connection

    响应头
    Location:服务器通过这个头告诉浏览器去访问哪个页面,这个头通常配合302状态码使用
    Content-Encoding: 服务器通过这个头告诉浏览器,回送的数据采用的压缩格式
    Content-Length:  服务器通过这个头告诉浏览器,回送的数据的大小
    Content-Type: 服务器通过这个头告诉浏览器,回送数据的类型
    Last-Modified: 服务器通过这个头告诉浏览器,资源的最后修改时间
    Refresh:服务器通过这个头告诉浏览器,定时刷新网页
    Content-Disposition: attachment; filename=aaa.zip:服务器通过这个头告诉浏览器,以下载方式打开数据
    ETag: W/"7777-1242234904000":缓存相关的头,为每一个资源配一个唯一的编号


    Expires: 0 
    Cache-Control: no-cache 
    Pragma: no-cache   这三个头组合使用,让浏览器不要缓存数据

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1068260.htmlTechArticle为你详细解读HTTP请求头的具体含意,解读请求含意 当我们打开一个网页时,浏览器要向网站服务器发送一个HTTP请求头,然后网站服务器根...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1655
14
PHP Tutorial
1252
29
C# Tutorial
1226
24
How to set up the keyboard boot function on a GIGABYTE motherboard (enable keyboard boot mode on GIGABYTE motherboard) How to set up the keyboard boot function on a GIGABYTE motherboard (enable keyboard boot mode on GIGABYTE motherboard) Dec 31, 2023 pm 05:15 PM

How to set up keyboard startup on Gigabyte's motherboard. First, if it needs to support keyboard startup, it must be a PS2 keyboard! ! The setting steps are as follows: Step 1: Press Del or F2 to enter the BIOS after booting, and go to the Advanced (Advanced) mode of the BIOS. Ordinary motherboards enter the EZ (Easy) mode of the motherboard by default. You need to press F7 to switch to the Advanced mode. ROG series motherboards enter the BIOS by default. Advanced mode (we use Simplified Chinese to demonstrate) Step 2: Select to - [Advanced] - [Advanced Power Management (APM)] Step 3: Find the option [Wake up by PS2 keyboard] Step 4: This option The default is Disabled. After pulling down, you can see three different setting options, namely press [space bar] to turn on the computer, press group

The first choice for CS players: recommended computer configuration The first choice for CS players: recommended computer configuration Jan 02, 2024 pm 04:26 PM

1. Processor When choosing a computer configuration, the processor is one of the most important components. For playing games like CS, the performance of the processor directly affects the smoothness and response speed of the game. It is recommended to choose Intel Core i5 or i7 series processors because they have powerful multi-core processing capabilities and high frequencies, and can easily cope with the high requirements of CS. 2. Graphics card Graphics card is one of the important factors in game performance. For shooting games such as CS, the performance of the graphics card directly affects the clarity and smoothness of the game screen. It is recommended to choose NVIDIA GeForce GTX series or AMD Radeon RX series graphics cards. They have excellent graphics processing capabilities and high frame rate output, and can provide a better gaming experience. 3. Memory power

How to display file suffix under Win11 system? Detailed interpretation How to display file suffix under Win11 system? Detailed interpretation Mar 09, 2024 am 08:24 AM

How to display file suffix under Win11 system? Detailed explanation: In the Windows 11 operating system, the file suffix refers to the dot after the file name and the characters after it, which is used to indicate the type of file. By default, the Windows 11 system hides the suffix of the file, so that you can only see the name of the file in the file explorer but cannot intuitively understand the file type. However, for some users, displaying file suffixes is necessary because it helps them better identify file types and perform related operations.

Digital audio output interface on the motherboard-SPDIF OUT Digital audio output interface on the motherboard-SPDIF OUT Jan 14, 2024 pm 04:42 PM

SPDIFOUT connection line sequence on the motherboard. Recently, I encountered a problem regarding the wiring sequence of the wires. I checked online. Some information says that 1, 2, and 4 correspond to out, +5V, and ground; while other information says that 1, 2, and 4 correspond to out, ground, and +5V. The best way is to check your motherboard manual. If you can't find the manual, you can use a multimeter to measure it. Find the ground first, then you can determine the order of the rest of the wiring. How to connect motherboard VDG wiring When connecting the VDG wiring of the motherboard, you need to plug one end of the VGA cable into the VGA interface of the monitor and the other end into the VGA interface of the computer's graphics card. Please be careful not to plug it into the motherboard's VGA port. Once connected, you can

Understand common application scenarios of web page redirection and understand the HTTP 301 status code Understand common application scenarios of web page redirection and understand the HTTP 301 status code Feb 18, 2024 pm 08:41 PM

Understand the meaning of HTTP 301 status code: common application scenarios of web page redirection. With the rapid development of the Internet, people's requirements for web page interaction are becoming higher and higher. In the field of web design, web page redirection is a common and important technology, implemented through the HTTP 301 status code. This article will explore the meaning of HTTP 301 status code and common application scenarios in web page redirection. HTTP301 status code refers to permanent redirect (PermanentRedirect). When the server receives the client's

In which folder is the cookie data on your computer located? Detailed interpretation In which folder is the cookie data on your computer located? Detailed interpretation Jan 19, 2024 am 10:19 AM

With the continuous development of the Internet, people are increasingly inseparable from browsers. In browsers, everyone will use cookies more or less. However, many people don’t know which folder the cookie data is in. Let’s explain it in detail today. First, we need to understand what cookies are. Simply put, a cookie is a piece of text information stored by the browser, which is used to save some of the user's personal settings in the browser or record the user's historical operations, etc. When the user opens the same website again, c

Recommended keyboards for reducing hitting noise in games Recommended keyboards for reducing hitting noise in games Jan 05, 2024 am 10:36 AM

Go to Recommend Silent Gaming Keyboard If you want to enjoy a quiet experience while gaming, you may consider buying a silent gaming keyboard. Recommended products include CherryMXSilent, LogitechG915 and SteelSeriesApexPro. These keyboards are low-noise, lightweight and responsive. In addition, it is recommended to choose a keyboard with features such as adjustable backlight brightness, programmable functions, and comfortable feel to meet better usage needs. Recognized as the quietest keyboard "Duga K320", it is a much-loved electronic product. It is known for its excellent performance and features, making it an ideal choice for many people. Whether it is gaming, entertainment or office work, Duga K320 can provide excellent performance. it

Glodon Software's computer configuration recommendations; Glodon Software's computer configuration requirements Glodon Software's computer configuration recommendations; Glodon Software's computer configuration requirements Jan 01, 2024 pm 12:52 PM

Glodon Software is a software company focusing on the field of building informatization. Its products are widely used in all aspects of architectural design, construction, and operation. Due to the complex functions and large data volume of Glodon software, it requires high computer configuration. This article will elaborate on the computer configuration recommendations of Glodon Software from many aspects to help readers choose a suitable computer configuration processor. Glodon Software requires a large amount of data calculation and processing when performing architectural design, simulation and other operations. Therefore, the requirements for the processor are higher. It is recommended to choose a multi-core, high-frequency processor, such as Intel i7 series or AMD Ryzen series. These processors have strong computing power and multi-thread processing capabilities, and can better meet the needs of Glodon software. Memory Memory is affecting computing

See all articles