HTTP protocol Request header information and response header information detailed __http protocol header information

Source: Internet
Author: User
Tags apache tomcat

Request part of HTTPBasic structure
Request Line get/test/hello.html http/1.1 header (not every request) empty line content (content name = Content body)

Common message Headers (detailed HTTP request message headers)
accept:text/html,image/* (Tell server, browser can accept text, Web page picture) Accept-charaset:iso-8859-1 [Accept character encoding: Iso-8859-1] accept-encoding: Gzip,compress[can accept gzip,compress compressed data] accept-language:zh-cn[Browser supported language host:localhost:8080[browser to find the host] If-modif    Ied-since:tue,11jul 2000 18:23:51[told the server I have this file in the cache, the time of the file is ...] Referer:http://localhost:8080/test/abc.html[told the server where I came from, often used to prevent downloads, hotlinking] user-agent:nozilla/4.0 (Com ...)    [Tell the server my browser kernel] cookie:connection:close/keep-alive [Keep link, post data, I do not close link] date:[browser send data request time]


Request method: Post,get,head,delete,put,trace,
Get commit, transfer data size is about 2K (ie browser only)
Post submission, preferably at 64k or it will affect performance

HTTP response Information
Response header Information
location:http://www.baidu.org/index.jsp Server:apache Tomcat [told browser I was Tomcat] Content-encoding:gzip[told the browser I used gzip ] content-lenght:80 [Tell browser loopback data size] content-language:zh-cn[support Chinese] content-type:text/html;charset=gb2312[content format and Encoding] last-modified:tue,11 juj,2000 18 18:29:20[tells the browser what time the resource was last updated] refresh:1;url=http://www.baidu.com[How long did the brush New where to go] content-disposition;attachment;filename=aaa.zip[told the browser to have file download] transfer-encoding:chunked[transmission Code] Set-cook Ie:expires:-1[tells the browser how to cache pages] Cache-control:[tells the browser how to cache the page (because browser compatibility is best set two)] Pragma:no-cache CONNECTION:CL Ose/keep-alive date:tue,11 June 2000 18:23:51
(1) Some sites are relatively high in timeliness, we do not cache the page
Response.setdateheader ("Expires",-1);
To ensure compatibility
Response.setheader ("Cache-control", "No-cache")
Response.setheader ("Pragma", "No-cache")
(2) Some Web sites require Web pages to cache a certain amount of time, such as caching one hours
Response.setdateheader ("Expires", System.currentimemillis () *3600*1000*24);


General Information Header
Cache-control:no-cache
Pragma:no-cache
Connection:close/keep-alive

Date: Time


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.