An introduction to the HTTP

The guide

This article will introduce you to the concept of HTTP

  1. What is the HTTP
  2. The part that the URL contains
  3. The role of DNS
  4. What are domain names and what are they

What is the HTTP

HTTP is HyperText Transfer Protocol. HTTP is two protocols based on TCP and IP. If you want to access a website, you need IP and port. Each computer or mobile phone has its own IP address. IP mainly determines how to locate a device, encapsulate data packets, and communicate with other devices. How to view IP: Enter the following command:

ipconfig

Copy the code

When we visit the website, there will be Intranet and extranet, which can not be directly connected. We need to use the router as an intermediary to help us transfer data, send requests, and finally see the display of the website. Port: a server can provide many services, each service has a number, this number is called port (port) so we want to ask, how do I know what I need is so many port which port, here to recommend a query ports website query Commonly used mainly has the following three ports

port function
80 For transferring web pages
443 For transferring web pages
21 File transfer protocol

There are two rules that must be followed:

  1. Ports 0-1023 are used by the system
  2. Both port and IP are necessary

The part that the URL contains

A complete URL would contain the following, as shown in the figure:


The URL contains the protocol, domain name or IP, port number, path, query string, anchor point.

So how do you request different pages in a URL?

You can do that by changing the path, so you can try it out

How do I display different pages on the same page?

You can do this by querying parameters

How to display different locations in the same content?

You can change the anchor point. It should be noted that the anchor will not be transmitted to the server, the anchor does not support Chinese

The domain name

Domain name is simply a string of links of.com,.net,.org. We can query baidu’s IP by ping baidu.com command. One domain name can correspond to different IP addresses This is called host sharing and the domain name is also hierarchical. Now many websites can be directly accessed without starting with WWW. For example, Baidu can be directly written baidu.com. It can be inferred that the Domain Name level is as follows: 1.com is the top-level Domain Name. 2.baidu.com is the second-level Domain Name. 3 www.baidu.com is the third-level Domain Name.

  1. The browser queries the IP address of the DNS server provided by Telecom/Unicom
  2. Returns the IP
  3. Port 80/443 of the corresponding IP address sends the request

conclusion

In fact, URL to understand some of the relevant knowledge of the network, to be clear between the Intranet and the Internet is not directly connected, need to pass a certain program unicom, in learning we can query some nuggets blog to learn URL related knowledge. Remember to keep learning and follow up! Come on!