New issues with occasional updates (HTTP protocol What happens when you enter a URL in a browser?) )

Source: Internet
Author: User

HTTP protocol:

Hypertext Transfer Protocol is the most widely used network protocol in the Internet. HTTPS is a security-targeted HTTP channel, which is the security version of HTTP

Why do we have this agreement?

In order to establish a connection between the client and the server, let the two communicate

Self-understanding: Let the computer according to the rules of speech, you ask me, how do you ask me how to answer, or the computer will say the words have no way to communicate

HTTP is communicated through messages.

Request message: request header, request line, request body

Response message: Response header, response line, response body

Request Header: Accept: Specifies the type of content that the client can receive, Cache-control: Specifies the caching mechanism that the request and response follows, and when the cookie;http request is sent, all the Cookie values that are stored under that request domain are sent to the Web server.

Date: The day and time the request was sent, etc. (this is too much to remember)

Request lines: Request method (common post and get), request address (URL), request protocol, and version (http/1.1)

Request body: Like passing data with a post form such as: Name=aimee age=18 name=aimee&age=18 will appear in the request body

Response Line: Response protocol and version number (http/1.1), Response status Code (200) Response status text (OK)

Response header: Allow: A valid action for a specific resource connection the option that is expected for the link the ETag is an identifier for a particular version of a resource, usually a message hash (listing several)

Response Body: The data we requested back

Status code:

1XX received request to continue processing

2XX success

3xx redirection

4XX Client Error

5XX Server Error

Common Status Codes:

Success Status Code: 200 indicates success, 301/302 temporary/Permanent REDIRECT 304 resource not modified

Failure status code: 404 request content does not exist, 500 server is temporarily unavailable, 503 server Internal Error

The difference between the request method get and post:

Get uses a URL or cookie to pass a parameter, and post places the data in the body

Get URL has a length limit, post can pass a lot of data

Post is safer than get

What happens when you enter a URL under the browser: 1. The browser resolves to the service IP via DNS domain name

DNS (domain Name System, sometimes referred to as domain name), which can map domain names and IP addresses to one another distributed database, makes it easier for people to access the Internet without remembering the number of IP addresses that can be read directly by the machine. Domain name suffix:. Top,. xyz,. com,. cn,. edu. Features: Unique and non-repeatable

An IP address is an Internet host that is used as a digital identifier for route addressing and is not easily remembered. Therefore, a domain name is created as a character type identifier.

In order to identify an entity, TCP/IP addresses the single host-to-Internet connection by using the IPs, and DNS helps us work with domain name-to-IP address mapping 2. Client establishes TCP connection to server via TCP protocol

TCP Protocol (Transport Layer Protocol): Before you formally send and receive data, you must establish a reliable connection with the other party. A TCP connection can be built up by three ' conversations '.

UDP protocol: Non-connected to the protocol, that is, before the formal communication with the other party first to establish a connection, regardless of the status of the other party directly sent, I think this is very similar to mobile phone messages, in the text, only need to enter the other's mobile phone number can be

3. The client sends an HTTP protocol packet to the server, requesting the server's resource document 4. The server sends the HTTP protocol answer package 5 to the client. Client and server disconnects, client begins to interpret processing HTML document

New issues with occasional updates (HTTP protocol What happens when you enter a URL in a browser?) )

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.