As the saying goes, the joint tune does not know the status code, read the interface is in vain, this paper recorded the status code encountered, so that the status code is no longer boring, and convenient access and familiar with, I wish you as soon as possible in the heart of no code, early to work

Random encounter unfamiliar status code, familiar with it, and then will update

1XX Connection correlation

101 Switching Protocols Switching protocol

When you open the LeetCode page and look at the network, you will find a status code of 101

So, curious as you are, you click in, and the status code equals

  1. The client side of the students to use the ordinary firsthttpRequest to ask the server, we canupgradeupgradewebsocketEstablish a connection
  2. And the server side says, okay, no problem, let’s have funwebsocketThe connection!

In addition to upgrading from HTTP 1.1 to Websocket, you can also upgrade from HTTP 1.1 to HTTP 2

Easy to remember: cut from 1 to 0, and then from 0 to 1 to switch protocols

Reference: juejin. Cn/post / 684490…

4XX client related

401 Unauthorized Is Not authorized

The front-end monitoring platform captures a 401 status code, because the interface requested by the client needs to verify authorization, but the request may not carry authorization information or authorization information verification fails

Easy to remember: 1 -> secret key

403 Forbidden Forbidden access

Front-end monitoring platforms capture a 403 status code, an MP3 file stored in a cloud is barred from access, and unlike 401 can not be authenticated again

Easy to remember: 3 -> Flash, dodge, forbid access

408 Request Timeout

Description 408 status code statistics were found in domain name link monitoring

This status code indicates that the request has timed out. The server has not received the request for a long time and wants to close the HTTP connection

The client must have failed, so the server should close the connection

422

429 Too Many Requests

If you swipe through leetcode and submit multiple times in a short period of time, you’ll see something like this

Open the network, you can see this loving status code, students, although it is very cool to submit, but please pay attention to moderation

Convenient memory: 4 + 2 = 6, 996 although very cool, but the body is the capital of ma (Zhuan) oh, too much request

499 Client Closed Request The Client is disconnected

The Nginx log was captured to 499

The client waited too long for the server to respond and then disconnected

5xx Related to the server

500 Internal Server Error Indicates an Internal Server Error

The front-end monitoring platform captured a 500 status code, and the server could not respond to the request

Easy to remember: 500, 00, 0 nothing, server internal error

502 Bad Gateway Indicates an incorrect Gateway

The front-end monitoring platform captures 502 status code, which is issued by a gateway or proxy server, indicating that the response it receives from the upstream server is invalid. Note The proxy server received an invalid response from an upstream server in The screenshot.

Easy to remember: 2 -> 250, error, wrong gateway

504 Gateway Timeout The Gateway times out

At the end of the spring race, Leetcode returns a 504 status code sent by a gateway or proxy server indicating that the response it received from the upstream server has timed out. The gateway did not receive a Timely response from The upstream server or application.

Convenient memory: 4 -> when the gateway times out

Note leetcode system maintenance as well