ASP. NET HTTP Protocol

Source: Internet
Author: User


HTTP is stateless, will not remember the "last Request * * *", so even the same page of JS, CSS, JPG also have to repeat the submission of accept-language, accept-encoding, cookies and so on. In general, only the browser requests the server side, the server side only to the browser response data, the server does not actively push data to the browser, this is security considerations, but also improve the performance of the server.  If you want the server to push data to the browser, you need to use additional techniques such as Serverpush (Ajax interval to the server requesting the latest data). Client and server communication it's like making a phone call. • Do we use Chinese or English? (Syntax-http protocol for contract communication) • Get ready to say (prepare the data to be transmitted to each other in accordance with the syntax) • Dial the phone (establish connection) • Speak via telephone/telephone line (transmission of data via the Internet-socket) • Note: Two people have to take the pair of microphones (both sides of the communication are concerned about receiving the data) • "OK": "302": Found redirect. • "$": Bad Request error requests, wrong request for non-compliant HTTP protocol • "403": Forbidden forbidden • "404": Not Found not found. The demo accesses a nonexistent page reading the text • "$": Internal server error Server internal errors. The presentation page throws an exception. • "503": Service unavailable. The average number of visitors is too large. Paragraph 200 is successful; Paragraph 300 requires further processing of the request, 400 indicates a client request error, and 500 segment is a server error. HTTP protocol-Introduction1:web development is to deal with the HTTP protocol and must understand the HTTP protocol. Http protocol version: http/0.9, http/1.0, http/1.1, now the mainstream is the http/1.1 version 2:http Protocol analysis tool: • 1, the contents of the Debugbar,http (S) tag. Free of charge. Only content in the current browser can be parsed. • 2, HttpWatch, charged, can only analyze the contents of the current browser. Recommended Use • 3, Httpanalyzer, charged, can analyze all the HTTP request data on the computer. • 4, wfetch_1.4, free, small analysis tools 3:http several concepts of the protocol: • 1. Connection (Connection): A channel that transmits data between the browser and the server.                              The general request is closed and HTTP is not kept connected. Not maintaining a connection slows processing (because a connection is slow), and keeping the connection slows down the number of client requests processed by the server without keeping the connection server from processing more requests. ·2. Request: The "I want to * *" message that the browser sends to the server, including the type of request, the requested data, the browser's information (language, browser version, and so on). ·3. Response (Response): The data returned by the server to the browser request, including success, status code, and so on. Request message:1:get/http/1.1 indicates that the server is requested to GET the home page, using the http/1.1 protocol 2:accept-encoding gzip, deflate that the browser supports gzip, Deflate two compression algorithms 3:accept-language ZH-CN represents the language supported by the browser, and many of the international websites that enter the Chinese interface automatically are implemented by reading the value of this header. 4:user-agent is the version information for the browser. Through this information can be read browser is IE or Firefox, supported plug-ins,. NET version, and so on. 5:cookie is a cookie that the browser sends to the server and is associated with the current Web site, so that the browser-side cookie can be read on the server side. 6:connection keep-alive. In general, once the Web server sends the request data to the browser, it closes the TCP connection, and if the browser or server joins the connection:keep-alive in its header, the TCP connection remains open after it is sent, so The browser can continue to send requests through the same connection. Maintaining a connection saves the time it takes to establish a new connection for each request and also saves network bandwidth. Response message:1:server:cassini/3.5.0.5 represents the type of server 2:content-type: Common content-type:text/html, Harset=utf-8, Image/gif, Image/JPEG, text /plain, Text/javascript, Application/x-excel, Application/octet-stream (binary) 3:content-length:19944 represents the byte length of the echo style, The header is simply a description of the specific data returned (such as HTML text, image data, etc.) after two carriage returns. The server uses Content-type to tell the client the type of data it responds to, so that the browser does different processing based on the type of the returned data, if it is the type of the picture, if the text type is displayed directly, if the content is displayed in the browser using the HTML type, If it is a download type, the download tool will pop up.

ASP. NET HTTP Protocol

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.