This is the fourth day of my participation in the August Text Challenge.More challenges in August

Today, I will review the basic knowledge, and most of the following articles should also review the previous knowledge points, to have a deep understanding, lay a good foundation, deeply influenced by the teachers in the youth training camp, know the importance of the foundation and principles.

content

A full URL

(1) Transmission protocol

Rules for exchanging information between a client and a server. There are three common rules:

  • ftp:
    • File Transfer protocol (FTP), commonly used to share files over the network, using ports 20 and 21.
    • The goal of FTP is to improve file sharing and transfer data reliably and efficiently.
  • http:
    • Hypertext transfer protocol, TCP/IP protocol, the most common web transfer protocol.
    • HTTP transmits information in plaintext. Therefore, if someone intercepts the packets transmitted between the server and the client, the information can be directly obtained. Therefore, HTTP has certain security risks.
  • https:
    • Based on theThe SSL protocoltheHTTP protocol security version.
    • Before the client and server interact with each other, the two sides continue to perform operations such as information encryption and identity authentication to ensure information security.
  • httpwithhttpsThe difference between:
    • HTTPS requires the Certificate Authority (CA) to apply for a Certificate.
    • HTTP is transmitted in plain text, whereas HTTPS is transmitted in SSL encryption
    • The default HTTP port is 80 and the default HTTPS port is 443.

(2) Domain name /IP address

Let’s start with IP. Every URL that you can access on a web page in a browser has its own public IP address, which can be used to access a host on the Internet, such as http://202.108.22.5/. However, people are not used to remembering monotonous numbers, but prefer meaningful words. Hence domain names and DNS.

  • DNS:
    • The Domain Name System (DNS) is a distributed database that remembers the mapping between Domain names and IP addresses. It runs on UDP and uses port 53.
    • The process of obtaining the corresponding IP address from the host name is called DNS (host name) resolution

(3) the port number

The host name (IP/ domain name) of the server is like a cell, and the port is like the number of each house in the cell. After finding the server, the client obtains information based on the corresponding port. A server can have multiple ports, and each application has one port. Different ports provide us with different services, including some of the functions and protocols we mentioned above, each occupying a different port. If the URL contains the port number, the default port number is 80.

(4) Request path /

When you have a domain name and a port number, you have found a specific place to request information. A virtual directory is a more specific target, what are the things in the directory that you’re going to request? For example: you have found the kiosk (port) at the gate of Tian ‘anmen Square (domain name) in Beijing, then the specific target of your request is the Coke (request file) in the second row (path) of the refrigerator in the kiosk.

(5) Request parameters

When we send a request to the server, we can also carry some information to the server, which is the request parameters, such as: www.baidu.com? Wp = don’t click in & ABC =123, and the request parameters are carried after the “?”. Take the snack bar above for example: While you request a bottle of Coke (request information), you also bring him a five dollar bill and two one dollar coins (request parameters).

Common requests are as follows:

  • GET: Usually used to request information, the address bar will display the request parameters
  • POST: is used to submit information. Request parameters are not displayed in the address bar
  • DELETE: Is used to send deletion requests to the server.
  • UPDATE: Is used to send modification requests to the server.

(6) Hash value hash

The hash is also called the anchor part of the URL. When we set the href attribute of the HTML a tag to “# + id “:

<a href="#abc">link</a>
Copy the code

And click, also can be found in the address bar, and does not refresh the page:

There are the following conclusions:

  1. The # represents a location on the page, followed by a character that identifies that location on the page.
  2. A change in the hash value in the URL does not cause HTTP requests and overloads, and HTTP requests do not contain hash values
  3. # changes the browser’s access history.
  4. jsCan be achieved bywindow.location.hashread#The value ofonhashchangeEvent listeners#This is also in front-end routingHash routingOne of the implementation principles of.

I hope you can point out any questions in the comments section, AND I will correct them in time.

New people on the road, but also include more. I am MoonLight, a fledgling small front end.