The principle of HTTP protocol and common Web page status code

Source: Internet
Author: User
Tags domain server

One: DNS DNS: Domain name resolution forward parsing: Resolving the domain name to IP echo resolution: Resolving IP to a domain name

Features of DNS: distributed, hierarchical

Domain structure: root domain, top-level domain (country/region domain), level two domain

Full domain name format: fqdn= host name. DNS suffix, example: www.souhu.com

The DNS resolution process accesses www.baidu.com as a client. For example: 1. Find the local DNS cache and Hosts file 2. Find LDNS (local DNS) server (cache) 3. Locate root domain server 4. Locate the. com top-level domain Server 5. LDNS requests the. com server to locate baidu.com server 6. LDNS Request Baidu.com Server 7. The baidu.com server returns an IP resolution record for the www.baidu.com domain name to LDNS 8. LDNS returned to the client to parse the record and cache it to the local

Second, the basic overview of the Web page: divided into Dynamic Web pages and static pages

Static Web pages: written in HTML, the extension is. htm,. html, which can contain text, images, sounds, Flash animations, client-side scripting and ActiveX controls, and Java applets. There are no background databases, no programs, and Web pages that can be interacted with. Newer and more troublesome, applicable to the general update less display site (company homepage). Each static page has a fixed URL, and the URL is suffixed with the common form of. htm,. html,. shtml, and not "?".

Dynamic Web pages: pages written in development languages such as ASP (Active Server pages), JSP (Java Server pages), PHP (hypertext preprocessor). The suffix is in. aspx,. asp,. jsp,. PHP,. Perl,. CGI, etc., and there is a symbolic symbol in the Dynamic Web page URL-"?" The content of a dynamic Web page can change over time, environment, or database operation. Dynamic Web pages with various animations, scrolling subtitles and other visual dynamic effects are not directly related, as long as the use of dynamic website technology production of Web pages can be called "Dynamic Web page."

XHTML: Pseudo-static for faster user access

Version of the HTTP protocol: note: HTTP 0.9 retired HTTP 1.0 This is the first HTTP protocol version that specifies the version number in the communication and is still widely used, especially in proxy servers. HTTP 1.1 current version. Persistent connections are adopted by default and work well with proxy servers. It also supports the simultaneous sending of multiple requests in a piped manner to reduce line load and increase transmission speed.

The difference between the get and post submission methods

Get method: Get data from the specified server Post method: Submit data to the specified server processing get request can be cached POST request cannot be cached GET request will be saved in browser's browsing record the POST request will not be saved in the browser's browsing record GET request to have length limit P The OST request has no length limit the string that is used primarily to get a data query is not displayed in the URL, and the string that compares the security query is displayed in the URL, unsafe

HTTP status Code

200 Series and 300 series both represent the success of the 400 series and the 500 series represent the failure

OK

The request was successful, and the desired response header or data body will be returned with this response.

201 Created

The request has been implemented, and a new resource has been established according to the request, and its URI has been returned with the location header information. If the necessary resources cannot be established in time, the ' 202 Accepted ' should be returned.

202 Accepted

The server has accepted the request but has not yet processed it. As it may be rejected, the request may or may not be executed at the end. In the case of asynchronous operation, there is no more convenient way to send this status code. A response that returns a 202 status code is intended to allow the server to accept requests from other processes

302 Move temporarily

The requested resource temporarily responds to the request from a different URI. Because such redirects are temporary, the client should continue to send subsequent requests to the original address. This response is cacheable only if specified in Cache-control or Expires.

304 Not Modified

The server should return this status code if the client sends a conditional GET request and the request has been allowed, and the contents of the document (since the last time it was accessed or based on the requested condition) have not changed. The 304 response suppresses the inclusion of the message body, so it always ends with the first empty line after the message header.

Request

1, the semantic error, the current request can not be understood by the server. Unless modified, the client should not submit the request repeatedly. 2. Wrong request parameters

401 Unauthorized

The current request requires user authentication. The response must contain a Www-authenticate information header for the requested resource to ask for user information. The client can repeatedly submit a request that contains the appropriate Authorization header information. If the current request already contains the Authorization certificate, the 401 response indicates that the certificate has been rejected by the server authentication.

403 Forbidden

The server has understood the request, but refuses to execute it. Unlike the 401 response, authentication does not provide any help, and the request should not be repeated.

404 Not Found

The request failed and the requested resource was not found on the server. No information can tell the user whether the situation is temporary or permanent. The most likely cause of this error is that the server side does not have this page.

408 Request Timeout

The request timed out. The client does not complete a request in the time the server is waiting to be sent. The client can submit the request again at any time without making any changes.

Internal Server Error

The server encountered an unexpected condition that prevented it from completing the processing of the request. In general, this problem occurs when the source code on the server side is wrong.

501 Not implemented

The server does not support a feature that is required for the current request. When the server does not recognize the requested method and cannot support its request for any resource.

502 Bad Gateway

An invalid response was received from the upstream server when the server acting as a gateway or agent attempted to execute the request.

503 Service Unavailable

The server is currently unable to process the request due to temporary server maintenance or overloading. This situation is temporary and will be resumed after a certain period of time.

504 Gateway Timeout

When a server acting as a gateway or agent attempts to execute a request, it fails to receive a response from the upstream server (the server that the URI identifies, such as HTTP, FTP, LDAP), or the secondary server (such as DNS).

HTTP message Detailed

Request Header:

get/http/1.1//Submission method with HTTP protocol version 20/27 Host:www.benet.wang//hostname connection:keep-alive//whether to remain connected Accept:text/html,appli CATION/XHTML+XML,APPLICATION/XML;Q=0.9,IMAGE/WEBP,/; q=0.8//Media type UPGRADE-INSECURE-REQUESTS:1//Support Upgrade unsafe request , not only HTTP but https user-agent:mozilla/5.0 (Windows NT 10.0; WOW64) applewebkit/537.36 (khtml, like Gecko) chrome/45.0.2454.101 safari/537.36//client type Accept-encoding:gzip, deflate, SDCH//Page support compression accept-language:zh-cn,zh;q=0.8//language type

Response header:

http/1.1//http Protocol version and Status code Date:thu, OCT 15:50:23 GMT//Date and time SERVER:APACHE/2//server version information X-POWERED-BY:PHP/5 .6.21//Dynamic server version information Content-encoding:gzip//Transfer compression vary:accept-encoding,user-agent keep-alive:timeout=2, max=99//Long connection time Co Nnection:keep-alive//Support long connection transfer-encoding:chunked

content-type:text/html; Charset=utf-8//media type and Character set

The principle of HTTP protocol and common Web page status code

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.