What is the Http
There is no doubt that Http is an acronym for HyperText Transfer Protool. The first problem solved is that Http is HyperText Transfer Protocol.
What is the hypertext Transfer protocol
To solve the problem of what is, it is a good choice to disassemble it, so it is segmented into “hypertext”, “transmission” and “protocol”. To look at
hypertext
Hypertext is still a separable concept, and it’s much easier to understand when it’s broken up into “super” “text,” that is, text. Hypertexts, then, are carriers that carry more information than words. In the context of prior art, images, video, audio, hyperlinks, etc. Therefore, we can first get a popular concept, hypertext is pictures, video, audio, hyperlinks and other information carriers. Now let’s look at transport
transmission
Transmission is well understood, in popular terms, as the transfer of something from one point to another. To put it on the web is to send the hypertext you just mentioned from the client to the server. Just like entering a train station requires swiping an ID card, the transmission of hypertext also needs to be regulated. If it is too disorderly, the high-speed train originally destined for Beijing may end up all the way to Harbin. And so the deal came
agreement
Agreements are common in life, employment agreements, labor agreements and so on. If you think about it, there are several characteristics between these agreements:
- It was negotiated by both parties
- Binding on both sides
These features also make sense over the Internet.
Stage summary
After that, the definition of hypertext Transfer protocol (HYPERtext Transfer Protocol) is ready. Let’s organize the language and put it in the context of the computer world. Here it is:
In the computer world, the specification and convention for transferring hypertext, such as pictures, text, video, etc. from end to end 。
However, this is not the end, our own definition can only help us understand, to the textbook version of the definition, also need to click on Baidu, type Http. The precise definition is as follows:
It’s official, it’s a little bit complicated, but hopefully you get the idea.
Http history and version
I thought I’d skip the history and version section because it wasn’t important, but learning from history has become an essential part of human progress throughout history and throughout the world. Here’s a quick look at what Http looked like in the past:
The original Http – Http 0.9
Http at this time, pay attention to is concise, at that time only processing text disorderly protocol, pictures can not be processed. Then increased demand forced Http to evolve, so there’s no such thing as a technology-driven company, it’s a business-driven company.
Http New Era -Http 1.0
In 1982, proposed by TimBerners-Lee, the parties specify the connection mode and connection type, establishing and disconnecting one connection per request/response. Simple, easy to manage, and widely used.
Http in the Internet age -Http 1.1
The use of long connections improves the performance overhead caused by short links in the 1.0 era, supports pipe network transmission, and can initiate a second access without waiting for the first access back, which is more efficient. Want to see more detailed tools.ietf.org/html/rfc261 can click on the following address…
Http over Https -Http 2.0
Whatever Https is, Http 2.0 is more secure, with header compression, binary formatting, data streaming, multiplexing, server push, and more. The same, want to understand, click below tools.ietf.org/html/rfc754…
Status code
After looking at the history, it’s time to start to get into the topic a little bit. Why choose the status code to cut in, because it’s familiar
This 404
This 404
And a 404 like this
So, here’s the problem. Everyone knows that 404 pops up when a website is not accessible. So what is 404?
tipsIf you are using Chrome, you can unplug the cable and control the dinosaur to pass the time:
The highest score is 548, which is probably not bad. Let’s get back to what a 404 status code is.
meaning
As mentioned above, Http itself is a request response protocol, and the status code is the 3-digit code of the server response status. It is generally divided into five categories, as follows:
classification
- 1XX: The request has been received and is in the intermediate state of protocol processing. Subsequent processing is required. Such as 100 Continue, 101 Switching Protocols, etc., are not used much.
- 2XX: This type of status code is probably the most popular among developers. Most of the time, it represents a successful debugging. This type of status code indicates that the request is received, understood, and accepted by the server. For example
- 200 OK: The request is successful
- 204 No Content: basically the same as 200, but without body data.
- 3XX: redirection. The location of the resource changes and the client needs to resend the request. When the browser receives the redirected response, it will access the new URL, and there will be a small performance penalty that is not visible to the user. Just a couple of examples
- 300 Multiple Choices: The requested resource has a selection of feedback information.
- 302 Move Temporarily: The requested resource Temporarily responds to a request from a different URL
A more detailed redirection can be found at developer.mozilla.org/zh-CN/docs/… .
- 4XX: Category 404 has occurred. This type of error means that the client has an error and the server cannot handle it
- 400 Bad Request: Indicates an error packet sent by the client
- 403 Forbidden: The server forbids access to resources
- 404 Not Found: The requested resource was Not Found on the server or was Not Found
- 5XX: Indicates that the client is correct, but an error occurs inside the server
- 501: Internal Server Error: The Server encountered an unknown Error
- 502: Bad Gateway: an invalid response is received from the upstream server when the server working as a Gateway or proxy tries to execute the request.
- 503: Service Unavailable: The server says, I am busy and will try again later
Once you’ve seen these status codes, how do you see them in the real world? The easiest way to do this is to open Chrome (or go next if you don’t have one), press F12, click the NetWork Tab, select one of the requests, click Headers, and find the Status Code for the current request.
conclusion
In the first chapter, I will stop here and talk about some simple points related to ordinary life in my own way. From the beginning of the second chapter, I will carry out detailed analysis.