Some time ago, when I was working on a project, I found that I was still confused about the interaction between the front and back end. Sometimes, I would take a long time after a problem appeared. So I turned to The illustrated HTTP book first, and here are some tips to keep in mind while reading.

1.1 Accessing the Web Using HTTP

The Web browser obtains information such as file resources from the Web server based on the URL to display the Web page. A Web browser that sends a request for a server resource is called a client. The Web uses a protocol called HTTP as a specification to complete a series of operations from the client side to the server side.

1.2 The birth of HTTP

1.2.1 Planning the Web for Knowledge Sharing

WWW three construction techniques:

  • HTML that uses SGML as the text markup language for pages
  • HTTP as a document delivery protocol
  • The URL that specifies the address of the document

1.3 Basic NETWORK TCP/IP

Commonly used networks, including the Internet, operate on the basis of the TCP/IP protocol family. HTTP is one of its internal children.

1.3.1 TCP/IP protocol family

The protocols associated with the Internet are collectively called TCP/IP.

1.3.2 Layered TCP/IP Management

The most important aspect of the TCP/IP protocol family is layering. It is divided into the following four layers: application layer, transport layer, network layer, and data link layer.

  • The application layer determines the activities of communication when providing application services to users. HTTP is in this layer.
  • The transport layer has two different protocols: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
  • The network layer (network interconnection layer) is used to handle packets (the smallest unit of data transmitted over the network) that flow over the network. This layer defines the path (transmission path) through which the packets are sent to the other computer.
  • The link layer (data link layer, network interface layer) handles the hardware part of the network that connects to it. Including control operating system, hardware device driver, NIC and optical fiber and other physical visible parts (also including connectors and other transmission media).

1.3.3 TCP/IP Traffic


Type a header for the layer
The first elimination



encapsulation

1.4 Protocols closely related to HTTP: IP, TCP, and DNS

1.4.1 IP protocol responsible for transmission

The IP network protocol is located at the network layer. “IP” is actually the name of a protocol. Function: send various data packets to each other. IP address and MAC Address The IP address (changeable) indicates the address to which a node is assigned, and the MAC address (mostly unchangeable) indicates the fixed address to which the nic belongs. An IP address can be paired with a MAC address. Use ARP to communicate by MAC address The communication between IP addresses depends on MAC addresses. On the network, it is rare for two parties to communicate in the same LAN. They usually connect to each other through the transfer of multiple computers and network devices. During the transfer, the MAC address of the transfer device at the next station is used to search the next transfer target. In this case, ARP is used. ARP is a protocol used to resolve addresses. The MAC address can be traced based on the IP address of the communication party. Network devices such as computers and routers have only a rough idea of the route they will take before reaching their destination. (Routing mechanism)

1.4.2 TCP to ensure reliability

TCP is at the transport layer and provides reliable byte stream service (for convenient transmission, large chunks of data are divided into packet segments for management). TCP divides the data to make it easier to transmit big data, and TCP ensures that the data is eventually sent to the other party.

TCP uses the three-way handshake to deliver data to the destination accurately. The sender (packet with the SYN mark) – > the receiver received word (a packet with SYN/ACK logo to convey confirmation) – > the sender received (packet with the ACK mark) – > if the receiver (handshake) terminal at a certain stage in the process of shaking hands, TCP will once again to send the same data in the same order.

1.5 DNS Service for Domain name Resolution

DNS: a protocol at the application layer similar to HTTP that resolves domain names to IP addresses. Computers can be assigned either IP addresses (computers are better at processing long strings of numbers and are easier for computers to understand) or host names and domain names (which are more in line with human memory habits). The DNS protocol provides the service of querying IP addresses by domain names or reverse-searching domain names from IP addresses.

1.6 Relationship between Protocols and HTTP

1.7 the URI and URL

We are more familiar with urls (Uniform resource Identifiers) than urIs (Uniform resource Identifiers).

1.7.1 the URI

A URI represents an Internet resource as a string, and a URL represents the resource’s location (its location on the Internet). Courseware urls are a subset of URIs.

1.7.2 URI format

Indicates the specified URI. The absolute URI, absolute URL, and relative URL (the URL specified from the basic URI in the browser, for example, /image/ ha.gif) should be used to contain all required information.


  • Login Information (authentication) (Optional) Specify the user name and password as the login information (authentication) required for the server to obtain resources.
  • Server ADDRESS To use the absolute URI, you must specify the address of the server to be accessed. The address can be a DNS resolvable name like hackr.jp, an IPv4 address name like 192.168.1.1, or an IPv6 address name enclosed in square brackets like 0:0:0:0:0:0:0:1.
  • Server port (Optional. If omitted, the default port is automatically used.) Specifies the network port to which the server is connected.
  • Hierarchical file paths specify file paths on the server to locate specific resources.
  • Query string (Optional) You can use the query string to pass in any parameter for a resource within a specified file path.
  • Fragment Identifiers (optional) Fragment identifiers are usually used to mark a child resource (a location within a document) within an acquired resource.

Not all applications are COMPLIANT with THE RFC (some of the documents used to specify technical standards for the HTTP protocol).