Request:
Request Line --GET | post/1.html HTTP/1.1 // request method, page
Request Header--
Accept: text/html, image/* // tell the server the file format supported by the client
Accept-charset: UTF-8 // The encoding used by the client
Accept-encoding: gzip // client-supported Encoding
HOST: localhost // The host name that the client wants to access
If-modified-since: 18:00:00 GMT // tell the server the time point of the Client Cache
Referer: http: // www.xx.com/index.html // tell the server where the request is sent
User-Agent: chome/24 (compatible; MSIE 5.5; windows7) // tell the server about the client's software environment
Connection: Close | keep-alive // The connection is closed or maintained after connection.
Date: 18:00:00 GMT // request time
--- Empty row
Body --When the request is post, it can be used with data
-----------------------------------------------------------------------
Reponse:
Status line -- HTTP/1.1 200 OK // HTTP Version Status Code Description
1xx // the server has received the request, but the client can complete the following work only after another request
2XX // receives the request and responds successfully
3xx // The request fails. The client further requests
4xx // client Error
5xx // server error
Response Header -- // describe server information and notify the client to process data
Location: http://www.baidu.com // With 302 use tells client to request Baidu
Content-encoding:
Content-lenght
-- Empty line
Body -- // The data returned to the client