1. 3 protocol details the request line: GET/app1/1.html http/1.1GET: The request method. The default request method. Other common request methods are also post. Get features: The default request method. /app1/c.html?username=sdsfds&password=234324The requested data for the form is placed behind the requested URI. ? username=sdsfds&password=234324This is not good: exposing data, request line length is limited. Post features (often used): Use form forms in HTML. <form action= "c.html" method= "POST" >The request parameter appears in the body section. The length of the wood is limited. relatively safe. ---------------------------/APP1/1. HTML: The URI of the requested resource. ---------------------------HTTP/1.1: The version response line for the protocol used by the client: HTTP/1.1 200OK HTTP/1.1: Protocol version used by the server200: Response code. Represents a representation of the results processed by the server200: Normal302/307: redirect304: The server's resources have not been modified404: The requested resource does not exist500: Server error OK: Response code Description Request message Header: Send additional information to the server accept: Notifies the server that the browser can accept the MIME type. (The type of data that is distinguished by the file name extension in the file system.) MIME types are used to differentiate data types on the network. TOMCAT\CONF\WEB.MXL) MIME type name: Large type/Small Type Accept-Charset: Notification server, browser supported character set Accept-Encoding: Notifies the server that the browser can decode the data compression method. For example: gzip Accept-language: Notification server, desired language host: Requested host and Port*Referer: is a URL address. The value is the address of the page before the current page. Anti-theft chain*content-type: Notifies the server of the MIME type of the request body. Value: Application/x-www-form-The urlencoded default value corresponds to the Enctype property of the form form If-modified-Since: Notifies the server of the last modified time of the cached file. User-Agent: Notification server, browser type. Content-Length: Indicates the Connection of the request message body: Indicates whether a persistent connection is required. If the server sees the value here as "Keep-alive ", or see that the request is using an HTTP 1.1 (HTTP 1. 1 persistent connection by default*****Cookie: This is one of the most important request header information (session-related) Response message headers:*location: Notifies the client, indicating the location of the new resource (combined with 302/307来 use. Request redirection) Server: Notifies the client, the type of the server*content-Encoding: Notifies the client of the compression encoding of the response body. It is commonly used in gzip. *content-Length: Notifies the client of the data size of the response body*content-type: Notifies the client of the MIME type of the response body*Refresh : Let the browser be refreshed automatically. The value is an integer (the time interval of the refresh, in seconds) Refresh:3Refresh:3; Url=URI for other resources*content-Disposition: Notifies the client to open the resource in a downloaded manner. Content-disposition:attachment;filename=1. jpgSET-COOKIE:SS=Q0=5LB_NQ; path=/cookies sent by the search server (session-related)*expires:-1the effective time of the Web page. Unit is milliseconds*cache-control:no-cache (1.1) *pragma:no-cache (1.0) Notifies the client not to cache
1.3 Protocol details the request line: get/app1/1.html Http/1.1get: Request method. The default request method. Other common request methods are also post. Get features: The default request method. /app1/c.html?username=sdsfds&password=234324 put the requested data for the form behind the requested URI. username=sdsfds&password=234324 it's not good. : Exposure data; Request line length is limited. Post features (often used): Use form forms in HTML. <form action= "c.html" method= "POST" > Request parameters appear in the body section. The length of the wood is limited. relatively safe. ---------------------------/app1/1.html: The URI of the requested resource. ---------------------------http/1.1: Version response line for the protocol used by the client: http/1.1 okhttp/1.1: Server protocol version 200: response code. A representation of the results handled by the server 200: normal 302/307: REDIRECT 304: The server's resources have not been modified 404: The requested resource does not exist 500: the server has an error. OK: Response code description Request message Header: Delivery of additional information to the server accept: Notification server, The MIME type that the browser can accept. (The type of data that is distinguished by the file name extension in the file system.) MIME types are used to differentiate data types on the network. TOMCAT\CONF\WEB.MXL) MIME type name: Large type/small type accept-charset: Notification server, browser supported character Set Accept-encoding: Notifies the server, the browser can decode the data compression method. For example: Gzipaccept-language: Notifies the server, the desired language host: The requested host and Port *referer: is a URL address. The value is the address of the page before the current page. Anti-theft chain *content-type: Notifies the server that the MIME type of the request body. Value: application/x-www-form-urlencoded The default value corresponds to the Enctype property of the form form if-modified-since: Notifies the server that the last modified time of the cached file. User-agent: Notification server, browser type. Content-length: Indicates the length of the request message body connection: Indicates whether a persistent connection is requiredPick up. If the server sees the value here as "keep-alive", or sees the request using an HTTP 1.1 (HTTP 1.1 defaults to persistent connection *****cookie: This is one of the most important request header information (session-related) Response message headers: *location : Notifies the client, indicating the location of the new resource (combined with 302/307). Request redirection) Server: Notifies the client, the type of the server *content-encoding: Notifies the client, and the compression encoding of the response body. It is commonly used in gzip. *content-length: Notifies the client response body of the data size *content-type: Notifies the client of the response body of the MIME type *refresh: Let the browser refresh automatically. The value is an integer (the time interval of the refresh, in seconds) Refresh:3refresh:3; Url= Other resources uri*content-disposition: Notifies the client to open the resource in a downloaded manner. CONTENT-DISPOSITION:ATTACHMENT;FILENAME=1.JPG*****SET-COOKIE:SS=Q0=5LB_NQ; Path=/search Server-Side cookies (session-related) *expires:-1 pages are valid. Units are milliseconds *cache-control:no-cache (1.1) *pragma:no-cache (1.0) Notify clients not to cache
HTTP1.1 protocol Detailed