http请求报文解析(国外英文资料)
http请求报文解析(国外英文资料)
HTTP request message sample:
POST/pass/demo/requesttest.jsp HTTP / 1.1
Accept: image/GIF, image/x-xbitmap, image/jpeg, image/pjpeg, application/VND. Ms-powerpoint, application/msword, * / *
Referer: http://localhost: 8080 / pass/demo/test.jsp
The Accept - Language: useful - cn
Content-type: application/x-www-form - urlencoded
UA - CPU: x86
The Accept - Encoding: gzip, deflate
User-agent: Mozilla / 4.0 (compatible; MSIE 7.0; Windows NT 5.1;.net CLR 1.4322;.net CLR 2.0.50727)
Host: localhost: 8888
The Content - Length: 22
Connection: Keep Alive
The cache-control: no - Cache
Cookie: JSESSIONID = BDCE086BAE33415EBDA4B9
Name = % e %
HTTP response message sample:
HTTP / 1.1 200 OK
Server: Apache - 1.1 - / - Coyote
The Set - cookies: user_name = zhangsan
The content-type: text/HTML. Charset = GBK
The Content - Language: useful - CN
The Content - Length: 150
Date: Sun, 06 Mar 2011 01:55:21 GMT
< HTML > < body > < / body > < / HTML >
The specific meaning of the request header field
Accept: the MIME type that the browser accepts.
Accept-charset: the browser's acceptable character set.
Accept-encoding: the browser can encode data Encoding such as gzip.
Accept-language: the type of Language that the browser hopes to use when the server can provide more than one Language version.
Authorization: Authorization information, usually in response to the www-authenticate header sent to the server.
Connection: indicates whether a persistent Connection is required. If the Servlet see here has a value of "Keep Alive -", or see the request using the HTTP 1.1 (HTTP 1.1 persistent connections the default), it can make use of the advantages of a persistent connection, when the page contains multiple elements (such as an Applet, picture), significantly reducing the time required to download. To achieve this, the Servlet needs to be sent a Content - Length header in the response, the realization of the simplest method is: put Content into ByteArrayOutputStream, then