avatarKirti K

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

5012

Abstract

07 Temporary redirect</b></p><div id="baaf"><pre>Similar <span class="hljs-keyword">to</span> <span class="hljs-number">302</span>, it indicates that the requested resource has been temporarily moved <span class="hljs-keyword">to</span> a different URL.

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s used to redirect temporarily </span> but <span class="hljs-keyword">with</span> the expectation that the same method (<span class="hljs-keyword">GET</span>, POST, etc.) should be used <span class="hljs-keyword">for</span> the redirected request.</pre></div><p id="092d"><b>400 — Bad Request</b></p><div id="88de"><pre>The server cannot process the request due <span class="hljs-keyword">to</span> a client <span class="hljs-keyword">error</span>. Example: <span class="hljs-keyword">When</span> there<span class="hljs-comment">'s a syntax error in the request sent by the client.</span></pre></div><p id="99da"><b>401 Unauthorized</b></p><div id="dce4"><pre> The request requires <span class="hljs-keyword">user</span> authentication. Example: <span class="hljs-keyword">When</span> trying <span class="hljs-keyword">to</span> access a protected resource <span class="hljs-keyword">without</span> logging in.</pre></div><p id="4865"><b>403 — Forbidden</b></p><div id="c4a8"><pre>The server understood the request but refuses <span class="hljs-keyword">to</span> authorize it. <span class="hljs-symbol">Example:</span> <span class="hljs-keyword">When</span> trying <span class="hljs-keyword">to</span> access a resource <span class="hljs-keyword">for</span> which you don<span class="hljs-comment">'t have permission.</span></pre></div><p id="2c0d"><b>404 — Not Found</b></p><div id="2634"><pre>The server cannot find the requested resource. <span class="hljs-symbol">Example:</span> <span class="hljs-keyword">When</span> trying <span class="hljs-keyword">to</span> access a webpage that doesn<span class="hljs-comment">'t exist</span></pre></div><p id="b56e"><b>405 — Method not allowed</b></p><div id="1634"><pre>It indicates that the request method (<span class="hljs-keyword">GET</span>, POST, PUT, DELETE, etc.) <span class="hljs-built_in">is</span> <span class="hljs-built_in">not</span> supported <span class="hljs-keyword">for</span> the requested resource.

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s returned when trying to use an unsupported </span> HTTP method <span class="hljs-keyword">for</span> a particular resource.</pre></div><p id="a19e"><b>406 — Not Acceptable</b></p><div id="6a88"><pre>It indicates that the server cannot generate a response that meets the criteria specified <span class="hljs-keyword">in</span> the client<span class="hljs-comment">'s request headers.</span>

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s commonly used when the client </span> requests a response <span class="hljs-keyword">in</span> a format that the server cannot provide</pre></div><p id="610f"><b>500 —Internal server error</b></p><div id="b2f0"><pre>A generic <span class="hljs-keyword">error</span> message indicating that something has gone wrong <span class="hljs-keyword">on</span> the server.

<span class="hljs-symbol">Example:</span> <span class="hljs-keyword">When</span> there<span class="hljs-comment">'s an unexpected server-side issue that prevents </span> it <span class="hljs-keyword">from</span> fulfilling the request.</pre></div><p id="11ab"><b>501- Not Implemented</b></p><div id="121b"><pre>It indicates that the server does <span class="hljs-built_in">not</span> support the functionality required <span class="hljs-keyword">to</span> fulfill the request.

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s returned when the server doesn't </span> recognize the request method <span class="hljs-built_in">or</span> lacks the ability <span class="hljs-keyword">to</span> fulfill the request. </pre></div><p id="ab51"><b>502 — Bad Gateway</b></p><div id="b227"><pre>It indicates that the server received an invalid response <span class="hljs-keyword">from</span> an upstream server <span class="hljs-keyword">while</span> acting <span class="hljs-keyword">as</span> a gateway <span class="hljs-built_in">or</span> proxy.

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s often seen when there are communication issues between servers.</span></pre></div><p id="bc04"><b>503 — Service Unavailable</b></p><div id="51cf"><pre>The server <span class="hljs-built_in">is</span> currently unable <span class="hljs-keyword">to</span> handle the request due <span class="hljs-keyword">to</span> temporary overload <span class="hljs-built_in">or</span> maintenance <span class="hljs-keyword">of</span> the server. <span class="hljs-symbol">Example:</span> <span class="hljs-keyword">When</span> a website <span class="hljs-built_in">is</span> temporarily down <span class="hljs-keyword">for</span> maintenance.</pre></div><p id="2280"><b>5

Options

04 — Gateway Timeout</b></p><div id="b0a6"><pre>It indicates that the server, <span class="hljs-keyword">while</span> acting <span class="hljs-keyword">as</span> a gateway <span class="hljs-built_in">or</span> proxy, did <span class="hljs-built_in">not</span> receive a timely response <span class="hljs-keyword">from</span> an upstream server

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s often seen when there are communication issues </span> between servers <span class="hljs-built_in">or</span> <span class="hljs-keyword">when</span> an upstream server <span class="hljs-built_in">is</span> slow <span class="hljs-keyword">to</span> respond</pre></div><p id="d618"><b>505 — HTTP version not Supported</b></p><div id="1c3f"><pre>It indicates that the server does <span class="hljs-built_in">not</span> support the HTTP protocol version used <span class="hljs-keyword">in</span> the request.

<span class="hljs-symbol">Example:</span> It<span class="hljs-comment">'s returned when the client sends a request using an </span> HTTP version that <span class="hljs-built_in">is</span> <span class="hljs-built_in">not</span> supported <span class="hljs-keyword">by</span> the server.</pre></div><p id="c445"><b>511 — Network Authentication required</b></p><div id="21e7"><pre>It indicates that the client needs <span class="hljs-selector-tag">to</span> authenticate <span class="hljs-selector-tag">to</span> gain network access. </pre></div><h2 id="d01a">Tomorrow we will learn about CORS Policy Related Questions :)</h2><h1 id="d668">Happy Coding and Stay Tuned :)</h1><p id="9ce2" type="7">Kind is always cool !!!</p><p id="5043" type="7">Share knowledge to gain knowledge !!!!</p><p id="27de" type="7">Be kind and treat people with respect !</p><h1 id="16e6">If you find my blog helpful, then please subscribe, claps and follow to support :)</h1><figure id="7c31"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*8aLCtBeTmiwar2o11vM3Eg.png"><figcaption>100 Days of JavaScript Interview Prep: A Beginner’s Journey with Kirti Kaushal</figcaption></figure><div id="e307" class="link-block"> <a href="https://kirtikau.medium.com/javascript-day-33-mastering-javascript-basics-a-comprehensive-guide-for-interview-preparation-59b553a6d4d3"> <div> <div> <h2>JavaScript Day 33 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation</h2> <div><h3>100 Days of JavaScript Interview Prep: A Beginner’s Journey</h3></div> <div><p>kirtikau.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*lawVfuy3d5jEod_LeR0oOg.png)"></div> </div> </div> </a> </div><div id="2ba6" class="link-block"> <a href="https://kirtikau.medium.com/list/953da44e71ce"> <div> <div> <h2>Explore OpenAI, ChatGPT , Next.js, the React framework</h2> <div><h3>Explore OpenAI, ChatGPT , Next.js, the React framework that empowers developers with server-side rendering, static site…</h3></div> <div><p>kirtikau.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*2ad63dbb6593f826f599de4c13654700cb4eb24e.jpeg)"></div> </div> </div> </a> </div><div id="c8bb" class="link-block"> <a href="https://kirtikau.medium.com/list/6d895127c989"> <div> <div> <h2>100 Days of JavaScript Interview Prep: A Beginner’s Journey</h2> <div><h3>Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation (00 Days of JavaScript Interview Prep: A…</h3></div> <div><p>kirtikau.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*8d8cdc688baf567f542b369640fab7a739ff024f.jpeg)"></div> </div> </div> </a> </div><div id="47d8" class="link-block"> <a href="https://rohitsportsphysiorehabclinic.co.in/?source=post_page-----59b553a6d4d3--------------------------------"> <div> <div> <h2>Home - Krishna Sports Injuries Physiotherapy & Rehab Clinic</h2> <div><h3>Krishna Sports Injuries Physiotherapy & Rehab Clinic There are plenty ways how to make an appointment. You can call us…</h3></div> <div><p>rohitsportsphysiorehabclinic.co.in</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*MYkXRPtpWYWsRHEM)"></div> </div> </div> </a> </div></article></body>

JavaScript Day 34 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation

100 Days of JavaScript Interview Prep: A Beginner’s Journey

JavaScript Day 34 — Mastering JavaScript Basics: A Comprehensive Guide for Interview Preparation

Understanding the HTTP Status Code

Welcome to Day 34–100 Days of JavaScript Interview Prep: A Beginner’s Journey with understanding the HTTP Status Code.

WHAT DO YOU UNDERSTAND BY HTML ?

1. Hypertext Transfer Protocol (HTTP) is an application-layer protocol for transmitting hypermedia documents such as HTML.

2. It is foundation of data communication on the World Wide Web.

3. It follow a client-server model where a client (means browser) sends a request to the server and the server responds with the requested resource, typically a webpage.

MOST USABLE HTTP RESPONSE STATUS CODE

200 OK

The request has succeeded.
Example: When you successfully load a webpage.

201 Created

It indicates that the request has been fulfilled 
and a new resource has been created as a result.

Example: When a POST request is made to create a new resource on a server, 
such as submitting a form to create a new user account, 
the server might respond with a 201 
Created status code along with the details of the newly created resource.

202 Accepted

It indicates that the request has 
been accepted for processing, 
but the processing has not been completed yet.

Example: When a client sends a request to a server 
that requires time-consuming processing, 
such as batch processing or queuing a task for 
later execution, the server might respond with a 202 
Accepted status code to acknowledge the request 
without indicating whether it has been successfully completed.

204 NO Content

It indicates that the 
server has successfully processed the request and 
there is no content to send in the response payload.

Example: 
When a client sends a request that does not 
require a response body, such as a successful 
DELETE request to remove a resource, 
the server might respond with a 204 

No Content status code to indicate that the 
request was successful but there is no additional 
information to return in the response.

301 Moved Permanently —

The requested resource has been permanently moved to a new URL. 
Example When a webpage has been permanently redirected to a new location

302 Moved Temporarily

It indicates that the requested 
resource has been temporarily moved to a different URL.
Example: It's commonly used for temporary redirections.

307 Temporary redirect

Similar to 302, it indicates that the 
requested resource has been temporarily moved to a different URL.

Example: 
It's used to redirect temporarily 
but with the expectation that the same method (GET, POST, etc.) 
should be used for the redirected request.

400 — Bad Request

The server cannot process the request due to a client error.
 Example: When there's a syntax error in the request sent by the client.

401 Unauthorized

 The request requires user authentication.
 Example: When trying to access a protected resource without logging in.

403 — Forbidden

The server understood the request but refuses to authorize it.
Example: When trying to access a resource for which you don't have permission.

404 — Not Found

The server cannot find the requested resource. 
Example: When trying to access a webpage that doesn't exist

405 — Method not allowed

It indicates that the 
request method (GET, POST, PUT, DELETE, etc.) is not supported 
for the requested resource.

Example: It's returned when trying to use an unsupported 
HTTP method for a particular resource.

406 — Not Acceptable

It indicates that the server cannot 
generate a response that meets the criteria specified 
in the client's request headers.

Example: It's commonly used when the client 
requests a response in a format that the server cannot provide

500 —Internal server error

A generic error message indicating that something has 
gone wrong on the server.

Example: 
When there's an unexpected server-side issue that prevents 
it from fulfilling the request.

501- Not Implemented

It indicates that the server does not support the 
functionality required to fulfill the request.

Example: It's returned when the server doesn't 
recognize the request method or lacks the ability to fulfill the request.

502 — Bad Gateway

It indicates that the server received an 
invalid response from an upstream server while acting as a gateway or proxy.

Example: It's often seen when there are communication issues between servers.

503 — Service Unavailable

The server is currently unable to handle the request 
due to temporary overload or maintenance of the server. 
Example: When a website is temporarily down for maintenance.

504 — Gateway Timeout

It indicates that the server, while 
acting as a gateway or proxy, did not receive 
a timely response from an upstream server

Example: 
It's often seen when there are communication issues 
between servers or when an upstream server is slow to respond

505 — HTTP version not Supported

It indicates that the server does not support the 
HTTP protocol version used in the request.

Example: It's returned when the client sends a request using an 
HTTP version that is not supported by the server.

511 — Network Authentication required

It indicates that the client needs to authenticate 
to gain network access.

Tomorrow we will learn about CORS Policy Related Questions :)

Happy Coding and Stay Tuned :)

Kind is always cool !!!

Share knowledge to gain knowledge !!!!

Be kind and treat people with respect !

If you find my blog helpful, then please subscribe, claps and follow to support :)

100 Days of JavaScript Interview Prep: A Beginner’s Journey with Kirti Kaushal
Coding
Javascript Interview
Front End Development
Javascript Tips
Programming
Recommended from ReadMedium