In the current big front environment, separation of front and back side, front and back end isomorphism development such as the emergence of the cooperative work mode, more and more high to the requirement of the front, front end need to understand the knowledge is becoming more and more wide, often have friends asked during the interview, the browser input a link to the browser to display the entire web content occur a series of process, This process is inseparable from the HTTP request we share today! There are also many students who are always at the bottom of the front end when coordinating the front end API interface with the back end. Today’s series can make the front end students return to the top (slightly exaggerated haha).

HTTP was born

Before diving in, let’s take a look at his background and the original intent behind HTTP to help us understand it better.

The Web for knowledge sharing

HTTP was born in March 1989, in the early days of the Internet, which was still owned by a few people. Dr Tim Berners-Lee, of CERN, the European Organisation for Nuclear Research, has come up with an idea that would allow far-flung researchers to share knowledge. The original idea was HyperText with the help of multiple documents related to each other. A link to the mutually accessible WWW (commonly known as the World Wide Web). The WWW was the name of the client application that web browsers used to browse hypertext.

The coming of age of the Web

In November 1990, CERN successfully developed the world’s first Web server and Web browser. In January 1993, Mosaic, the forerunner of the modern browser, was unveiled at the National Center for Supercomputing Applications. It displays HTML images in inline form, and its excellent performance in graphics has made it quickly popular worldwide.

zh.wikipedia.org/wiki/Mosaic


Fast forward to the browser wars between Microsoft and Netscape around 1995, when each company made its own extensions to HTML, resulting in the need to write HTML pages that were compatible with both companies’ browsers, a problem that still vexes us front-end engineers today. In this competition between browser vendors. Not only did they turn a blind eye to the various web standardization developments at the time. New functions are frequently added without corresponding documentation. The browser wars came to an end around 2000 with the demise of Netscape Communications. But in 2004, the Mozilla Foundation released The Firefox browser, and the second browser war broke out. The Internet Exprlorer browser took five years to release from version 6 to 7, followed by eight, nine, and ten. Chrome, Opera, Safari and other browsers are also gaining market share.

HTTP stands still

HTTP/0.9 HTTP was introduced in 1990, but HTTP is not established as a formal standard. At this point, HP still stands for HTTP/1.0, so it is called HTTP/0.9.

HTTP/1.0 HTTP is published as a standard, is in 1996 May version named http1.0n recorded in RFC1945, although the seventh standard, but the protocol standard is still widely used in the server side.

HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1 HTTP/1.1

HTTP/2.0 Between 2010 and 2015, Google demonstrated an alternative way to exchange data between the client and server side by implementing an experimental SPDY protocol. It collects focus issues for developers on both the browser and server side. SPDY became the basis for the HTTP/2 protocol, recognizing the increased number of responses and addressing complex data transfers. After being formally standardized in May 2015, HTTP/2 has been extremely successful, with 8.7% of sites already using it, representing over 68% of requests, by July 2016. High-traffic sites are the most rapidly popularized, saving considerable costs and expenses on data transmission.

Basic NETWORK TCP/IP

To understand HTTP, it is necessary to take a look at the TCP/IP protocol family, the network commonly used. It operates on top of the TCP/IP family of protocols, and HTTP is a subset of that.

TCP/IP protocol family

Computers and network equipment communicate with each other. Both sides must be based on the same methods, for example, how to detect communication goals, by which side first communication, use what kind of language to communicate, how to end communication rules need to be determined in advance, such as different hardware, operating system, the communication between all this needs a kind of rules, and we are called the rules of this agreement. There are all kinds of things in the protocol, from the specification of the cable to the method of selecting the IP address, the method of finding the remote user, the order in which the two parties establish communication, and the grip page showing the steps to be processed, and so on. Take the Internet like this. The associated protocols are collectively called TCP/IP. Some say that TCP/IP refers to TCP and IP protocols. Some say that TCP/IP is the general name of the protocol family used in IP protocol communication.

Layered management of TCP/IP

There are benefits to having TCP/IP layered. For example, if the Internet has only one protocol scheme, and something needs to change, the designer must replace all the parts as a whole, and only replace the changes after layering. After planning the interface between the layers. The internal design of each level becomes free to change. It is worth mentioning that after the hierarchy. Design has also become relatively simple, and applications at the application level can only consider the tasks assigned to them, without having to figure out where on earth the other side is, what the transmission route is, and whether the transmission can be ensured. Wait for a problem.

1. Application Layer The application layer determines the communication activities when providing application services to users. Common application services for communication in the memory of TCP/IP protocol group, such as. The FTP and DNS. Services are two of the HTTP protocols that are also in this layer. Provides data transfer between two computers in a network connection. At the transport layer, there are two different protocols, TCP and UDP. 3. Network Layer The network layer deals with the packets that flow over the network. A so-called transmission route that reaches the other party’s computer and sends the packet to the other party. 4. The link layer is used to deal with the hardware part of the linked network, including the control operating system and the device drivers of the hardware. NC. And physical visible parts such as optical fibers. Hardware categories are within the scope of the link layer

TCP/IP traffic








A protocol closely related to HTTP. IP, TCP and DNS

Here are three protocols, IP, TCP, and DNS, that are closely related to HTTP in the TCP/IP protocol suite

The IP protocol responsible for transport

IP network protocols are located at the network layer. Internet Protoct may sound like an exaggeration. But that’s exactly what it is, because almost every system that uses a network uses IP, and IN the TCP/IP family, IP refers to the late protocol, and it takes up half the name of the protocol, so you can see how important it is, you can confuse IP with IP address, IP is the name of a protocol used to send packets to each other. To ensure that packets are sent to each other, various conditions must be met. Two important conditions are IP address and Mac address. An IP address can be paired with a Mac address. The IP address can be changed, but the Mac address cannot be changed. 1. The ARP protocol is used to communicate based on MAC addresses. On the Internet, communication of both sides in the same local area network (LAN) is very few, usually through multiple computers and network devices can be connected to each other, while in transit, will use the next station transfer device Mac address to search for the next goal, then using ARP protocol, the ARP is an agreement to resolve the address. The MAC address can be traced based on the IP address of the communication party. 2. No one has a complete picture of the state of traffic on the Internet. Computers, routers and other network equipment can only learn a rough map of the route through which it travels before reaching its destination. This mechanism is called routing, a bit like a Courier company delivery process, want to send it special delivery, as long as their own goods to the hub, you can know whether the Courier company to accept delivery, the Courier company’s distribution center to check the goods delivery address, the hub of clear or purse sent out which area, then the hub wisdom judgment in that area. Whether it can be delivered to each other’s homes. We want to use this metaphor to show that no matter which computer or network device he is on, he can’t fully grasp the details of the Internet.

TCP to ensure reliability

So-called byte stream service is to point to in order to facilitate transport, will be divided into segments for large data unit to manage the packets, and reliable transport services is able to pass the data accurately and reliably to each other, TCP protocol to us, in order to transmit large data more easily, to data segmentation, and TCP protocol can. Confirm whether the data is ultimately. Send to each other.

Ensure data etc. reach target





DNS service responsible for domain name resolution

The DNS service is suitable for protocols located at the application layer like TPHP shoes. It provides domain name to IP address resolution services. Computers can be assigned IP addresses as well as host names and domain names. Rather than using an IP address to access a computer, because it is more appropriate for human memory to use letters and numbers to specify a computer name than a set of pure numbers for an IP address. However, it is relatively difficult for computers to understand people’s livelihood, because computers are better at dealing with a long string of numbers. In order to solve the above problems, DNS service emerged. DNS protocol provides the service of searching IP address by domain name or reverse with IP address.

The URI and URL

We are more familiar with urls (Uniform resource Identifiers) than urIs (Uniform resource Identifiers). URL Specifies the web page address that you need to enter when accessing a web page using a browser. See below

URI format

Represents the specified URL. Use absolute URIs that cover all the necessary information, absolute urls, and relative urls, which are the urls specified from the basic UI in the browser. Let’s now look at the format of absolute urls
































Front-end Must Know must Know HTTP Request Series (1) Understand Web and network basics Front-end must know must Know HTTP Request series (2) Simple HTTP protocol Front-end must know must know HTTP request series (3) HTTP, HTTP information inside the packet Front end must know must know HTTP request series (4) HTTP status code that returns the result Front end Must know must know HTTP request series (5) Web server that collaborates with HTTP Front end Must know must know HTTP request series (6) HTTP header Front-end Know-it-all HTTP Request Series (7) HTTPS to ensure Web security Front-end know-it-All HTTP Request Series (8) Authentication to verify the identity of the visiting user Front-end know-it-all HTTP Request Series (9) Http-based function add-on protocol Front-end Know-it-all HTTP Request Series (10) Technology for building Web content Front-end must know must know HTTP request series (11) Web attack technology

What questions can be left in the comments section, continue to pay attention to, constantly updated!