Several concepts of the HTTP protocol:
1. Connection (Connection): A channel that transmits data between the browser and the server. The general request is closed, HTTP is not maintained, the connection is not maintained, and the processing speed is reduced (because the connection is slow), keeping the connection slows down the number of client requests processed by the server and does not keep the connection server from processing more requests.
2. Request: The browser sends the message "I want to * * *" to the server, including the type of the request, the requested data, the browser's information (language, browser version, etc.)
3. Response (Response): The server returns data to the browser request, including whether it is successful, error code, etc.
HTTP protocol message:
1. Request
- get/http/1.1 means to request the home page with a GET method to the server, using the http/1.1 protocol
- User-agent is the browser version information. Through this information can be read browser is IE or Firefox, supported plug-ins,. NET version, etc.
- Referer: Source page, owning page
2. Response
- Response code: "200" indicates a successful access, "302" means a temporary transfer for redirection, Response.Redirect () will allow the browser to request a redirect address again, the redirected request is get mode; "404" means not found
3. Content-type:text/html;charset=utf-8 indicates the type of return data
4, the server through the Content-type to tell the client the type of data response, so that the browser based on the type of return data to do different processing, if the type of picture is displayed, if the text type is directly displayed content, if the HTML type of the browser display content. Commonly used content-type:text/html, Image/gif, Image/jpeg, Text/plain (for normal text), Text/javascript
HTTP protocol Notes