How to view HTTP header information

Source: Internet
Author: User

Hyper Text Transfer Protocal is a hypertext transfer protocol used to transmit data between webpages. Http uses a request and response model, that is, interaction between browsers and web servers (HTTP transactions) this includes a request initiated by the browser and a response returned by the server. Requests and responses are essentially text streams. The client and server interpret them as the first and followed body parts.

 

An HTTP request consists of the header information and the body that may contain some data or parameters.

An HTTP response usually contains the header information and the HTML tag of the returned page.

 

So how can we view the HTTP header information? Firefox provides the livehttpheaders plug-in, which records the HTTP traffic received by the browser and the current request and response header information. The query characters of the get and post methods are also recorded, however, the response content is not recorded.

 

How do I install the livehtttpheaders plug-in?

In.

Figure 1-1

Click Install now to install the livehttpheaders plug-in, as shown in figure 1-2.

Figure 1-2

After the installation, let's see how to use it to view the HTTP header information.

Open the Firefox browser (ensure that the page is blank) and click the tools → livehttpheaders option in the menu bar. The page shown in Figure 1-3 is displayed.

Figure 1-3

Enter a URL in Firefox, And the livehttpheaders interface will generate some information, as shown in figure 1-4.

Figure 1-4

The code snippets generated in the figure are as follows (Red is a comment ):

Http: // localhost: 8080/myweb/tomcat.html (input test address)

Request Header

GET/myweb/tomcat.html HTTP/1.1 (using the get method, Protocol Version 1.1)

HOST: localhost: 8080

User-Agent: Mozilla/5.0 (windows; U; Windows NT 5.1; en-US; RV: 1.8.1.12) Gecko/20080201 Firefox/2.0.0.12

Accept: text/XML, application/XML, application/XHTML + XML, text/html; q = 0.9, text/plain; q = 0.8, image/PNG ,*/*; Q = 0.5 (defines the media types that can be processed by the client, sorted by priority; in a list separated by commas, you can define multiple types and use wildcards)

Accept-language: En-US, en; q = 0.5 (defines the natural language list that the client is willing to accept)

Accept-encoding: gzip, deflate (defines the encoding mechanism that the client can understand)

Accept-charset: ISO-8859-1, UTF-8; q = 0.7, *; q = 0.7

Keep-alive: 300

Connection: keep-alive

Response Header

HTTP/1.x 200 OK

Server: APACHE-Coyote/1.1

Etag: W/"71-1199901217640"

Last-modified: Wed, 09 Jan 2008 17:53:37 GMT

Content-Type: text/html

Content-Length: 71 (response body information to determine whether data is lost or damaged)

Date: Wed, 27 Feb 2008 13:18:52 GMT ......

For other header information, you can refer to the relevant information, which is not listed here.


Source: http://blog.sina.com.cn/s/blog_5f1fe33f0100d9zp.html

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.