HTTP codes cheatsheet
Tags: javascript, typescript, node
Published: 2022-08-19 08:55:00

***What are HTTP status codes***❓

An HTTP status code is **a server response to a browser's request**. When you visit a website, your browser sends a request to the site's server, and the server then responds to the browser's request with a three-digit code: the HTTP status code.

---

### 🔵 HTTP Status Codes

**100** - **Continue** — this status did the notification code that the server has received the first request and waits to receive further instructions from the browser.

**101** - **Switching Protocols** — it is used when the server receives the changes proposed by the browser. For example, changes from HTTP 1.0 to HTTP 1.1.

**102** - **Processing** — the server has received the request but has not completed it. This is to prevent the browser from interpreting that the request has been lost, but not yet completed.

**103** - **Checkpoint** — It is used to proceed with the request that was previously missing or cancelled.

---

### 🟢 HTTP Successful Codes

**200** - **OK**

**201** - **Created**

**202** - **Accepted**

**204** - **No Content** — server precessed the request successfully, but there          is nothing to return

---

### 🟡 HTTP Redirection Codes

**301** - **Moved Permanently**

**302** - **Moved Temporarily**

**304** - **Not Modified**

**307** - **Moved Temporarily** (preserves HTTP method)

**308** - **Moved Permanently** (preserves HTTP method)

---

### 🔴 HTTP Client Error Codes :

**400** - **Bad Request** — the request was not understood, malformed request syntax, etc.

<aside>
💡 Check your request for a missing required parameter or an invalid query parameter value.

</aside>

**401** - **Unauthorised** — when authentication is required, but was not provided.

<aside>
💡 The provided API key is invalid or missing.

</aside>

**403** - **Forbidden** — server is refusing action based on user not having necessary permissions for the resource.

<aside>
💡 The provided API key is invalid for the requested project.

</aside>

**404** - **Not Found** — but may be available in the future (e.g. not existing user on specific ID).

<aside>
💡 The requested resource does not exist

</aside>

**405** - **Method Not Allowed** — for example, when you do a POST request to a GET-only endpoint.

<aside>
💡 The requested HTTP method is not supported for the specified resource.

</aside>

**406** - **Not Acceptable** — generated data are in e different format than accepted by the client.

**408** - **Request Timeout** 

**409** - **Conflict** — edit conflict between multiple simultaneous updates.

**410** - **Gone** — similar to **404**, but indicates that the resource won’t ever be available again.

**411** - **Length Required** — request did not specify length of content.

**413** - **Payload Too Large** — the request is larger than the server is willing to process.

**414** - **URI Too Long** — typically when too many data are transferred via GET params.

**415** - **Unsupported Media Type** — request contains data in wrong format.

**429** - **Too Many Requests** 

<aside>
💡 The rate limit for the API has been exceeded.

</aside>

---

### 🟣 HTTP Server Error Codes

**500** - **To Many Requests** 

<aside>
💡 The rate limit for the API has been exceeded.

</aside>

**501** - **Not Implemented**

**502** - **Bad Gateway** — server acts as a proxy and received invalid response from the upstream server.

**503** - **Service Unavailable** — the server cannot temporarily process the request.

**504** - **Gateway Timeout** — server acts as a proxy and did not receive a response from the upstream server in defined time frame.

**505** - **HTTP Version Not Supported**