Web Service Basics

Source: Internet
Author: User
Tags website server purchase domain name

Basic process for Web Service basic user access to Web site
We use Web clients every day, the browser is a Web client, such as Google Browser, and Firefox browser. When we enter the www.oldboyedu.com/time, will soon be able to see the old boy Education official website, all this seems very mundane, behind what is the reason?
Ordinary people can not know, but as it developers, we have to have a clear understanding of the technology behind.

I'll give you the following. Basic process for users to visit the website

    1. The old boy educated a Python director, told a day lesson feeling very tired, and went off to bed with his MacBook Pro open, double-click the browser, After entering the www.pornhub.com URL, the system will first find the local DNS cache and Hosts file information, determine whether there is a www.pornhub.com domain name corresponding IP resolution record, if there is a direct access to the IP server, the first request, the DNS cache is not resolved records, H OSTs files are mostly developed for temporary testing
    2. If both the local DNS cache and the Hosts file do not have a domain name resolution record, the system will send a URL resolution request accessed by a Python director to the DNS server set by the client to resolve, also known as the local DNS, If the local cache of the LDNS server has a corresponding resolution record, it will be returned directly to the client IP address, and if no ldns will continue to request additional DNS servers
    3. Ldns continues from the DNS system's "." (root) begins to request the resolution of the www.pornhub.com domain name and, based on the DNS server system at each level, finds the authoritative DNS server that corresponds to the www.pornhub.com domain name on the DNS network. This authoritative DNS server is the Enterprise (personal) purchase domain name used to manage the domain name resolution of the server, the server has a corresponding domain name (IP) resolution.
    4. At this point, the authorized DNS server will www.pornhub.com corresponding IP resolution records, for example (1.1.1.1) sent to Ldns
    5. At this point, Ldns will send the parsing record to the browser, and cache the domain name and IP parsing records to facilitate the next faster return request
    6. The browser obtains the IP, requests the corresponding server, the website server receives the client request to begin the response processing, returns the content to the browser, then a Python director takes out a box of breeze card to draw the paper ....

Schematic DNS resolution

HTTP protocol
HTTP protocol, full name is hypertext Tansfer Protocol, Chinese called Hypertext Transfer Protocol, is the most common Internet protocol. HTTP most important is the WWW (World Wide Web) service, also known as the Web server, Chinese is called "www." Web Service port default is 80, another encrypted WWW service application HTTPS default port is 443, mainly for payment, net banking related business

Version

Since the advent of the HTTP protocol has several versions, mainly http/1.0 http/1.1http/1.0 that the browser and the server can only maintain a short-term connection, each request of the browser needs to establish a TCP connection with the server, the server completes the request, then disconnects the TCP connection. The server does not track each link and does not log the request http/1.1 is a major fix for HTTP flaws, from scalability, caching, bandwidth optimization, persistent connection, host header, error notification and other access improvements. http/1.1 supports long connections, adding more request headers and response header information, such as configuring the connection value of the request header to Keep-alive, indicating that the request result is returned and remains connected

HTTP request method

In HTTP communication, each request message contains a method that tells the Web server what needs to be done, which is called the HTTP request method
1    GET    requests the specified page information and returns the entity principal. 2    HEAD    is similar to a GET request, except that there is no specific content in the returned response, which is used to get the header 3    POST    to submit data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is included in the request body. A POST request may result in the creation of new resources and/or modification of existing resources. 4    PUT    replaces the contents of the specified document with the data sent from the client to the server. 5    Delete    requests the server to delete the specified page. 6 The Connect    http/1.1 protocol is reserved for proxy servers that can change connections to pipelines. 7    OPTIONS    allows the client to view server performance. 8    TRACE    echo the request received by the server, primarily for testing or diagnostics.

HTTP status Code

The HTTP status code indicates that the Web server responds to the status of the HTTP request with a common status code and the role of 1**    information, the server receives the request, requires the requestor to continue the operation 2**    successful, the operation is successfully received and handles 3**    redirection, Further action is required to complete the request 4**    Client error, the request contains a syntax error, or the request cannot be completed 5** the    server error, the server has an error while processing the request

Command view for HTTP status code

Curl-I www.oldboyedu.com
A 2018 : £ gmtcontent-type:text/ htmlcontent Connection:keep-Alivelocation:https://www.oldboyedu.com/
HTTP messages

Web Service Basics

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.