search
HomeWeb Front-endHTML TutorialHTTP header_html/css_WEB-ITnose

HTTP (HyperTextTransferProtocol) is the Hypertext Transfer Protocol, which is currently the common protocol for web page transmission. The HTTP protocol adopts a request/response model. The browser or other client issues a request and the server responds. As far as the entire network resource transmission is concerned, it includes message-header and message-body. First pass message- header, that is, http headerMessage. http header messages are usually divided into 4 parts: general header, request header, response header, entity header. However, in terms of understanding, the boundaries of this division are not very clear. According to the organization form of http header content in Wikipedia, it is roughly divided into two parts: Request and Response.

Requests section

Header explanation example

Responses part

Accept Specify the content type that the client can receive Accept: text /plain, text/html
Accept-Charset The character encoding set that the browser can accept. Accept-Charset: iso-8859-5
Accept-Encoding Specifies the content compression encoding type returned by the web server that the browser can support. Accept-Encoding: compress, gzip
Accept-Language Browser-accepted language Accept-Language: en,zh
Accept-Ranges You can request one or more sub-range fields of the web page entity Accept-Ranges: bytes
Authorization Authorization certificate for HTTP authorization Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Cache-Control Specify the caching mechanism followed by requests and responses Cache-Control: no-cache
Connection Indicates whether a persistent connection is required. (HTTP 1.1 uses persistent connections by default) Connection: close
Cookie When an HTTP request is sent, the cookie stored under the request domain name will be All cookie values ​​are sent together to the web server. Cookie: $Version=1; Skin=new;
Content-Length Requested content length Content- Length: 348
Content-Type The requested MIME information corresponding to the entity Content-Type: application/x-www-form- urlencoded
Date The date and time the request was sent Date: Tue, 15 Nov 2010 08:12:31 GMT
Expect Requested specific server behavior Expect: 100-continue
From Email of the user who made the request From: user@email.com
Host Specify the domain name and port number of the requested server Host: www.zcmhi.com
If-Match Only valid if the request content matches the entity If-Match: "737060cd8c284d8af7ad3082f209582d"
If-Modified-Since If the requested part is modified after the specified time, the request is successful. If it is not modified, a 304 code is returned If-Modified-Since: Sat, 29 Oct 2010 19:43:31 GMT
If-None-Match If the content has not changed, return 304 code , the parameter is the Etag previously sent by the server, and is compared with the Etag responded by the server to determine whether it has changed If-None-Match: "737060cd8c284d8af7ad3082f209582d"
If-Range If the entity has not changed, the server sends the missing part from the client, otherwise the entire entity is sent.Parameters are also Etag If-Range: "737060cd8c284d8af7ad3082f209582d"
If-Unmodified-Since Only if the entity has not been modified after the specified time The request is successful If-Unmodified-Since: Sat, 29 Oct 2010 19:43:31 GMT
Max-Forwards Restrict information from passing Time spent by proxies and gateways Max-Forwards: 10 : no-cache
Proxy-Authorization Authorization certificate to connect to the proxy Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Range Only request a part of the entity, specify the range Range: bytes=500-999
Referer The address of the previous web page, followed by the current requested web page, that is, the source Referer: http://www.zcmhi.com/archives/71.html
TE The transfer encoding that the client is willing to accept, and notifies the server to accept the tail plus header information TE: trailers,deflate;q=0.5
Upgrade Specify a transport protocol to the server for conversion (if supported) Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/ x11
User-Agent The content of User-Agent contains the user information that made the request User-Agent: Mozilla/5.0 (Linux; X11 )
Via Notify the intermediate gateway or proxy server address, communication protocol Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
Warning Warning information about the message entity Warn: 199 Miscellaneous warning
Header explanation example
Accept-Ranges Indicates whether the server supports specified range requests and what type of segmented requests Accept-Ranges: bytes
Age Estimated time in seconds from origin to proxy cache formation Age: 12
Allow A valid request behavior for a certain network resource. If it is not allowed, 405 will be returned Allow: GET , HEAD
Cache-Control Tell all caching mechanisms whether they can be cached and what type Cache-Control: no-cache
Content-Encoding The returned content compression encoding type supported by the web server. Content-Encoding: gzip
Content-Language Language of the response body Content-Language: en,zh
Content-Length The length of the response body Content-Length: 348
Content-Location Request an alternate address for the resource Content-Location: /index.htm
Content-MD5 Return the MD5 check value of the resource Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==
Content-Range In this part of the entire return body Byte position Content-Range: bytes 21010-47021/47022
Content-Type Return the MIME type of the content Content-Type: text/html; charset=utf-8
Date The time when the original server message was sent Date: Tue, 15 Nov 2010 08:12:31 GMT
ETag The current value of the entity tag of the request variable ETag: "737060cd8c284d8af7ad3082f209582d"
Expires The date and time the response expires Expires: Thu, 01 Dec 2010 16:00:00 GMT
Last-Modified The last modified time of the requested resource Last-Modified: Tue, 15 Nov 2010 12:45:26 GMT
Location is used to redirect the recipient to the location of the non-requested URL to complete the request or identify a new resource Location: http://www.zcmhi.com/archives/94.html
Pragma Contains implementation-specific instructions that can be applied to any receiver in the response chain Pragma: no-cache
Proxy-Authenticate It indicates the authentication scheme and parameters on that URL that can be applied to the proxy Proxy-Authenticate: Basic
refresh Apply to redirect or a new resource is created, redirect after 5 seconds (proposed by Netscape, supported by most browsers)

Refresh: 5; url=

http://www.zcmhi.com/archives/94.html

Retry-After If the entity is temporarily unavailable, notify the client to try again after the specified time Retry-After: 120
Server web server software name Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Set-Cookie Set Http Cookie Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1
Trailer Indicates that the header field exists at the end of the chunked transfer encoding Trailer: Max-Forwards
Transfer-Encoding File Transfer-Encoding Transfer-Encoding:chunked
Vary Tells the downstream proxy whether to use a cached response or request from the origin server Vary: *
Via Informs the proxy where the client response was sent Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
Warning Warning entity about possible problems Warning: 199 Miscellaneous warning
WWW-Authenticate Indicates the authorization scheme that the client requesting entity should use WWW-Authenticate: Basic
Statement
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
Why are HTML attributes important for web development?Why are HTML attributes important for web development?May 12, 2025 am 12:01 AM

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

What is the purpose of the alt attribute? Why is it important?What is the purpose of the alt attribute? Why is it important?May 11, 2025 am 12:01 AM

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

HTML, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML in Action: Examples of Website StructureHTML in Action: Examples of Website StructureMay 05, 2025 am 12:03 AM

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

See all articles

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 Article

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools