"Deng Geqi case of mind 2" - HTTP protocol status code

  We often hear the HTTP protocol, we will use the HTTP protocol every day, then what the next HTTP veil in the end what is it? We start to talk about today HTTP protocol status code.
  Speaking of the book back on the last time we continue the story of ~, as brother to brother Deng introduced a girlfriend (hammer sister), then shy Deng brother wrote a letter, let Tong help thinking to the hammer sister.
  Deng brother at this time is equivalent to the browser in the computer world, equivalent to hammer sister in the computer world server. Letter Deng brother to the younger sister of the hammer, the equivalent of a request sent by the browser to the server, the contents of the letter that we send out the contents of the request.
  Tong thought to hammer his sister's house, shouted the phrase cipher hammer sister in the door: "King cover ground tiger!." At this time there are many possibilities. Let's look at these possibilities in turn ~
  1
  after the signal if the screams, no one opened the door, this time next Pharaoh came out of thinking Tong said: "hammer moved, moved to 200 Main Street flower ~"
  this time thinking Tong 200 will go flowery street messenger, the permanent mobile this process is called (moved permanently), corresponding to a 301 HTTP status code. If our browser is the URL of this collection, then when after receiving the status code 301, the browser should be modified links, changes to the new URL. Of course, not only 3XX status code 301.
  2
  If the hammer sister did not move, but to girlfriends who lives temporarily.
  Then this is called temporary redirection, 302 corresponding to the status code. There is a status code 302 and function is very similar.
  3
  If next door to Uncle Wang said, who lives in the hammer to girlfriends, but if not a girl not to open the door ~
  In this case, a hammer girlfriends sister went home, so it is necessary temporary redirect, but this temporary situation and redirect 302 What difference does it make? The difference is that the request is not the same. Here is the messenger boys POST request method, request that the girls GET request method. This time status code is 303, expressed the need for temporary redirect, and must be requested with the GET method.
  4
  Of course, there are many possibilities: for example hammer sister did not even live in this -
  this case is called the system can not find the resources, the corresponding HTTP status codes is the famous 404.4XX family, there are many state
  5
  also there are some very interesting situations, such as thinking Tong to hammer home his sister, calling the wrong signal, shout became: "King cover hamster ~", this time the sister heard the hammers signal a crazy feeling out there, this time nor would open the door, thinking Tong directly away -
  this situation is our protocol format there is a problem, in this case the returned status code is: 401
  6
  another example, think Tong hammer to his sister's house, shouting the slogan: "! king cover ground tiger", but today hammer sister in a bad mood, just do not answer the door, thinking Tong go away, no matter how you say nice things - also called not to open the door (the girls thought you difficult to guess ~)
  this case is equivalent to the request is rejected by the server, HTTP status code: 403. But this state is very interesting, this is the reason the state can refuse to return are given bodies, but under normal circumstances, this status code do not want the server to use the case of the reasons given. So this case is consistent with the case of a girl angry - must be a reason, but not easily tell you ~
  7
  Let us assume, thinking Tong to hammer his sister's house, but the hammer sister was on the phone, no air Magnus Tong -
  Since before we set good, Deng brother is equivalent to the browser, hammer sister equivalent server, so the situation at this time is a busy server. The server is busy the corresponding status code 503. Usually when the server load status code 503 is returned.
  8
  Sitong hammer to his sister's house, the first signal to say: "King cover ground tiger ~." Hammer sister replied: "Deng brother five meters ~" Tong thinking: "pagoda town river demon ~" hammer sister: "Deng brother not grow ~" for after the sign, Tong thought the letter and handed hammer sister ~ (Si Tong finally gave it to hammer sister ~) but this time out of the question - hammer sister illiterate. . . This can not continue. . .
  Front process signal, just like the HTTP protocol parsing process. Read back process is a process equivalent to the letter processed after acquiring the data. However, since the hammer can not illiterate sister normal read channel. It's like the server program error has occurred, an error occurred during the reading of the letter. So this time quoted HTTP status code: 500
  9
  We assume that thinking Tong sister and a hammer right on the sign, hammer sister also know the word - a hammer sister Aberdeen after reading this letter, to back a brother Deng letter. Contents of the letter only two words: "Dream on ~." (After so much suffering, finally got a reply hammer sister ~)
  when the browser content to be transmitted is received and processed by the server, get the message returned by the server. Hammer sister's reply is equivalent to the information returned by the server. Such a back and forth to complete a HTTP request. This time the returned status code: 200
  10
  When thinking Tong after completion of the first messenger, Deng brother saw the reply hammer sister, I feel good mulberry heart - and decided to write a letter to hammer sister. When thinking another messenger to hammer Tong sister, sister of the hammer did not reply directly, but told Tong thinking, but also to the letter before Deng brother to see on the line ~ (hammer sister has been too lazy to write ~ )
  When the browser several times to access the same resources, if the result of the first request still in the cache, has not yet expired, then access the resources at this time, in order to reduce the consumption of network transmission, if the resource has not been modified , you can tell the browser to continue using previously cached content, so you do not have the resources then send it again, so we reduce a lot of network overhead. This time the server returns a status code: 304. Although this status code is 3XX series, but we can see this status code and redirect seemingly nothing to do - but we can understand, the server requires a browser redirects the request to the browser itself.
  More than ten state is the HTTP status code of the most common status codes, we also have to remember Web front-end beginner status codes. Of course, the status code of the HTTP protocol is much more than that. We speak HTTP protocol after the article, we will be more detailed to introduce HTTP protocol.

Guess you like

Origin blog.51cto.com/13409950/2456563