HTTP request Header

Source: Internet
Author: User

get/http/1.1

Host: www.baidu.com

user-agent:mozilla/5.0 (Windows; U Windows NT 5.1; En-us; rv:1.7.6)

gecko/20050225 firefox/1.0.1

Connection:keep-alive

post/http/1.1

Host: www.baidu.com

user-agent:mozilla/5.0 (Windows; U Windows NT 5.1; En-us; rv:1.7.6)

gecko/20050225 firefox/1.0.1

content-type:application/x-www-form-urlencoded

Content-length:40

Connection:keep-alive

Name=professional%20ajax&publisher=wiley (given in the form of a simple "name-value" pair)

Content-type explains how the content of the request body is encoded.

Content-length describes the number of bytes in the request body.

The most common request headers:

Accept: The MIME type acceptable to the browser.

Accept-charset: The acceptable character set of the browser.

Accept-encoding: The way the browser can decode data encoding, such as gzip. The servlet can return a GZIP-encoded HTML page to a browser that supports gzip. In many cases this can reduce download time by 5 to 10 times times.

Accept-language: The type of language the browser wishes to use when the server is able to provide more than one language version.

Authorization: Authorization information, which typically occurs in an answer to the Www-authenticate header sent to the server.

Connection: Indicates whether a persistent connection is required. If the servlet sees the value here as "keep-alive", or sees the request using an HTTP 1.1 (HTTP 1.1 is persistent by default), it can take advantage of the persistent connection, when the page contains multiple elements (such as applets, pictures), Significantly reduce the time it takes to download. To do this, the servlet needs to send a content-length header in the answer, and the simplest implementation is to write the content to Bytearrayoutputstream first and then calculate its size before formally writing the content.

content-length: Represents the length of the request message body.

Cookies: This is one of the most important request header information, as discussed in the following chapter, "Cookie Processing".

From: The email address of the requesting sender, used by some special Web client, is not used by the browser.

Host: The hosts and ports in the initial URL.

If-modified-since: Returns a 304 "not Modified" answer only if the requested content has been modified after the specified date.

Pragma: Specifying a value of "no-cache" means that the server must return a refreshed document, even if it is a proxy server and has a local copy of the page.

Referer: Contains a URL from which the user accesses the currently requested page from the page represented by the URL.

user-agent: Browser type, this value is useful if the content returned by the servlet is related to the browser type.

UA-PIXELS,UA-COLOR,UA-OS,UA-CPU: A nonstandard request header sent by some versions of Internet Explorer to indicate screen size, color depth, operating system, and CPU type.

HTTP request Header

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.