A concise and understandable course for HTTP headers

Source: Internet
Author: User
Tags http request w3 total cache

This paper makes a concise and understandable exposition of HTTP headers, and I just take a little note.

What is HTTP Headers

HTTP is written by "Hypertext Transfer Protocol," which is used throughout the World Wide Web, and almost all of what you see in your browser is transmitted through HTTP protocols, such as this article.

HTTP headers is the HTTP request and the corresponding core, it hosted on the client browser, request page, server and other related information.


Example

When you type a URL in the browser's address bar, your browser will resemble the following HTTP request:
GET /tutorials/other/top-20-mysql-best-practices/ HTTP/1.1
Host: net.tutsplus.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=r2t5uvjq435r4q7ib3vtdjq120
Pragma: no-cache
Cache-Control: no-cache

The first line, called "Request Lines", describes the basic information of the request, and the rest is the HTTP headers.

After the request is complete, your browser may receive an HTTP response such as the following:

HTTP/1.x 200 OK
Transfer-Encoding: chunked
Date: Sat, 28 Nov 2009 04:36:25 GMT
Server: LiteSpeed
Connection: close
X-Powered-By: W3 Total Cache/0.8
Pragma: public
Expires: Sat, 28 Nov 2009 05:36:25 GMT
Etag: "pub1259380237;gz"
Cache-Control: max-age=3600, public
Content-Type: text/html; charset=UTF-8
Last-Modified: Sat, 28 Nov 2009 03:50:37 GMT
X-Pingback: http://net.tutsplus.com/xmlrpc.php
Content-Encoding: gzip
Vary: Accept-Encoding, Cookie, User-Agent
<!-- ... rest of the html ... -->

The first line is called "Status Line", which is followed by HTTP headers, which starts to output when the empty line is finished (some HTML output in this case).

But you can't see the HTTP headers when you look at the page's source code, although they are sent to the browser along with what you can see.

This HTTP request also sends out some requests for other resources, such as pictures, CSS files, JS files, and so on.

Let's take a look at the details below.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.