{"id":127,"date":"2026-07-13T12:01:44","date_gmt":"2026-07-13T12:01:44","guid":{"rendered":"https:\/\/blog.csfree.org\/?p=127"},"modified":"2026-07-14T08:20:53","modified_gmt":"2026-07-14T08:20:53","slug":"http-status-codes","status":"publish","type":"post","link":"https:\/\/blog.csfree.org\/index.php\/2026\/07\/13\/http-status-codes\/","title":{"rendered":"Mischief Managed: A Harry Potter Guide to HTTP Response Codes"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Mischief Managed: A Harry Potter Guide to HTTP Response Codes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have you ever wondered what actually happens behind the scenes when you click a link or type a website address? It feels like magic\u2014and honestly, it&#8217;s not that different from sending a message at Hogwarts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To understand how exactly this works, let\u2019s imagine your web browser (like Chrome or Safari) is <strong>Harry Potter<\/strong>, and the website&#8217;s server is the <strong>Hogwarts Library<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When Harry wants a book, he sends an owl with a note. What happens next is exactly how the web communicates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is a HTTP response?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An <strong>HTTP Response<\/strong> is the package of data the server (the waiter) brings back to your browser (the customer) after processing your request. or If we have to describe simply, the <strong>HTTP Response<\/strong> is the owl flying back to Harry with Madam Pince&#8217;s reply. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When Harry opens the envelope, it contains three things:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Body:<\/strong> The actual magic book Harry asked for (the HTML\/CSS\/JavaScript of the webpage), or simply, <strong>the data that makes up the<\/strong> <strong>webpage you see on your screen<\/strong>.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Status Line:<\/strong> A quick note taped to the top telling Harry if the errand was successful, or simply, <strong>A quick progress report (this includes the HTTP response\/status code).<\/strong><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Headers:<\/strong> The &#8220;metadata&#8221; on the back of the envelope\u2014the date, the official Hogwarts library stamp, and a note saying <em>&#8220;Warning: This book contains moving pictures.&#8221;<\/em>, or simply put, M<strong>etadata about the response, like the date, what kind of server it is, and the type of content being sent back<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">but now, the question arises, <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is an HTTP status code?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Madam Pince, the Hogwarts librarian, is far too busy to write long letters to every student. Instead, she uses a simple <strong>3-digit shorthand code<\/strong> right at the top of her note to instantly tell Harry how his request went. These 3-digit numbers are <strong>HTTP Status Codes<\/strong>. The very first digit tells Harry what kind of situation he is dealing with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In general we can define it as- <strong>An <em>HTTP Response Code<\/em> (often called a status code) is a 3-digit number included right at the top of that response. It acts as a universal shorthand that instantly tells your browser exactly how the request went.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What are the various Status Codes we see, in our day-to-day life?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1XX: Informational Responses<\/strong> &#8211;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>1xx Informational codes<\/strong> are the web&#8217;s way of saying, &#8220;<strong>I heard you, I&#8217;m working on it, so don&#8217;t close the page yet!&#8221;<\/strong> If we have to explain more clearly, Putting on the <strong>Sorting Hat<\/strong>. It doesn&#8217;t sort you instantly; it sits on your head muttering, <em>&#8220;Hmm, let&#8217;s see&#8230; where to put you&#8230;&#8221;<\/em> while you wait. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are multiple <strong>1xx status codes<\/strong>, they are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>100 Continue<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This happens in two parts. The browser asks if it&#8217;s okay to send a huge file, and the server says go ahead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Browser&#8217;s Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>POST \/upload-video HTTP\/1.1\nHost: website.com\nContent-Length: 2147483648\nExpect: 100-continue<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Server&#8217;s Interim Response:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 100 Continue<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(After this, the browser immediately starts transmitting the actual video file data).<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>101 Switching Protocols<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This code is used when a browser wants to upgrade a standard web connection to a permanent, live WebSocket connection (like for a chat room).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Browser&#8217;s Request:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>GET \/chat HTTP\/1.1\nHost: website.com\nUpgrade: websocket\nConnection: Upgrade<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Server&#8217;s Response:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 101 Switching Protocols\nUpgrade: websocket\nConnection: Upgrade<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(The HTTP connection is now closed, and a live WebSocket channel is officially open).<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>102 Processing<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This is an interim response sent back by the server during a very long task to stop the browser from timing out while it waits for the final results.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Server&#8217;s Interim Response:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 102 Processing<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(The server sends this, keeps working on the heavy task behind the scenes, and will send a <strong><code>200 OK<\/code> <\/strong>code several seconds later when the job is actually finished).<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>103 Early Hints<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This tells the browser to start downloading critical styles and fonts while the server takes its time building the actual HTML webpage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Server&#8217;s Interim Response:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 103 Early Hints\nLink: &lt;\/styles\/main.css&gt;; rel=preload; as=style\nLink: &lt;\/fonts\/inter.woff2&gt;; rel=preload; as=font<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(While the browser goes off to fetch <strong>main.css<\/strong>, the server finishes gathering database data and will send the standard <strong>200 OK<\/strong> code with the full HTML right after).<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2XX: Successful Responses-<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>2xx status codes<\/strong> mean your browser\u2019s request was s<strong>uccessfully received, understood, and accepted by the server.<\/strong> Think of this as successfully casting a spell on the first try. You swish and flick your wand, say <em>&#8220;<strong>Wingardium Leviosa<\/strong>,&#8221;<\/em> and the feather instantly floats into the air exactly like you wanted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are multiple <strong>2xx status codes<\/strong>, they are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>200 OK<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The standard &#8220;<strong>success<\/strong>&#8221; <strong>code<\/strong>. The server found what you asked for and handed it over.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 200 OK\nContent-Type: text\/html\n\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;&lt;body&gt;&lt;h1&gt;Welcome to Hogwarts&lt;\/h1&gt;&lt;\/body&gt;&lt;\/html&gt;<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>201 Created<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Your request succeeded, and <strong>a brand-new resource was built on the server <\/strong>because of it (<strong>like a user successfully signing up<\/strong>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 201 Created\nLocation: \/users\/harry_potter\nContent-Type: application\/json\n\n{\"status\": \"User profile successfully created\"}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>202 Accepted<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server accepted your request, but it is going to p<strong>rocess it in the background later<\/strong>. It hasn&#8217;t finished yet, but it&#8217;s <strong>queued up<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 202 Accepted\nContent-Type: application\/json\n\n{\"task_id\": \"9\u00be\", \"status\": \"Video processing has started in the background\"}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>204 No Content<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The request was completely <strong>successful<\/strong>, but the server <strong>doesn&#8217;t need to send any data or text back in the body<\/strong> (common for hitting a &#8220;Delete&#8221; button).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 204 No Content<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>205 Reset Content<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server tells the browser t<strong>o completely clear or clear out whatever form the user is currently looking at<\/strong> (like resetting a registration form back to blank).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 205 Reset Content<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>206 Partial Content<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The browser only asked for a <strong>chunk of a massive file<\/strong> (like a specific 10-second slice of a long video), and the server is <strong>delivering just that specific piece.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 206 Partial Content\nContent-Range: bytes 0-1023\/2048\nContent-Length: 1024<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>207 Multi-Status<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Used in <strong>WebDAV environments<\/strong>. If you send a request that <strong>performs multiple distinct operations at once<\/strong>, this response bundles several different <strong>individual status codes inside an XML body<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 207 Multi-Status\nContent-Type: text\/xml\n\n&lt;multistatus xmlns=\"DAV:\"&gt;\n  &lt;response&gt;\n    &lt;href&gt;\/file1.txt&lt;\/href&gt;\n    &lt;status&gt;HTTP\/1.1 200 OK&lt;\/status&gt;\n  &lt;\/response&gt;\n&lt;\/multistatus&gt;<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>208 Already Reported<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Used inside a <code>207 Multi-Status<\/code> response to tell the browser, <em>&#8220;<strong>Hey, I already processed and listed this specific folder path earlier in this message, so I&#8217;m not going to repeat myself.<\/strong>&#8220;<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;response&gt;\n  &lt;href&gt;\/duplicate-folder\/&lt;\/href&gt;\n  &lt;status&gt;HTTP\/1.1 208 Already Reported&lt;\/status&gt;\n&lt;\/response&gt;<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>226 IM Used<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server is sending a <strong>modified version of a cached resource<\/strong>. Instead of sending the entire webpage, it only <strong>sends the exact edits<\/strong> (the deltas) <strong>that have changed since the last time you downloaded it<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 226 IM Used\nDelta-Base: \"v1-cache-hash\"<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3XX: Redirection Messages-<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>3xx status codes<\/strong> mean that the <strong>resource you are looking for has moved<\/strong>, and your browser needs to take an extra step to go to a <strong>different address <\/strong>to find it.  Think of this as the <strong>Moving Staircases<\/strong> at Hogwarts. You try to walk down a specific corridor to get to your classroom, but the staircase suddenly shifts gears mid-walk, forcing you to follow a completely different pathway to reach your final destination.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are multiple <strong>3xx status codes<\/strong>, they are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>300 Multiple Choices<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The request has more than one possible response. The browser or<strong> user must choose which one they want<\/strong> (e.g., choosing between different video formats or language versions).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 300 Multiple Choices\nContent-Type: application\/json\n\n{\n  \"choices\": &#91;\n    {\"lang\": \"en\", \"url\": \"\/en\/hogwarts\"},\n    {\"lang\": \"fr\", \"url\": \"\/fr\/hogwarts\"}\n  ]\n}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>301 Moved Permanently<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The webpage has been <strong>permanently assigned a new URL.<\/strong> Any future requests should use the new link provided in the <strong><code>Location<\/code> header<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 301 Moved Permanently\nLocation: https:\/\/new-hogwarts-site.com\/library<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>302 Found<\/code> (Temporary Redirect)<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The webpage is <strong>temporarily living at a different URL<\/strong>, but it will <strong>return <\/strong>to its old address in the future. The browser should keep using the <strong>original URL<\/strong> next time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 302 Found\nLocation: https:\/\/temporary-classroom.com\/dada<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>303 See Other<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server <strong>found the data you requested<\/strong>, but it wants you to <strong>fetch it using a distinct <code>GET<\/code> request<\/strong> at a different URL (very common after submitting a form so you don&#8217;t resubmit it by accident).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 303 See Other\nLocation: \/payment-success-page<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>304 Not Modified<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server tells your browser, <em>&#8220;<strong>The webpage hasn&#8217;t changed since the last time you visited, so just load your local cached copy to save time and data.<\/strong>&#8220;<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 304 Not Modified\nCache-Control: max-age=3600<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>305 Use Proxy<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Deprecated\/Old.<\/em> It used to tell the browser that the <strong>requested resource could only be accessed by going through the specific proxy server listed in the location header<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 305 Use Proxy\nLocation: http:\/\/my-secure-proxy.com:8080<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>306 Switch Proxy<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>No longer used.<\/strong><\/em> This was originally designed to tell the browser that subsequent requests should use a specified proxy, but it is now completely dead and reserved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 306 Switch Proxy<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>307 Temporary Redirect<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This acts exactly like a <code>302 Found<\/code>, but with one major rule: the browser <strong>must not change the HTTP method<\/strong> used. If you sent a <code>POST<\/code> request with form data, you must send that exact same <code>POST<\/code> request to the new temporary URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 307 Temporary Redirect\nLocation: https:\/\/backup-api.com\/submit-form<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>308 Permanent Redirect<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This acts exactly like a <code>301 Moved Permanently<\/code>, but with the same strict rule as <code>307<\/code>: the browser <strong>must keep the exact same HTTP method<\/strong> (like <code>POST<\/code>) when hitting the new permanent address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 308 Permanent Redirect\nLocation: https:\/\/main-api.com\/v2\/submit-form<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4XX: Client Error Responses-<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>4xx status codes<\/strong> mean that <strong>something went wrong<\/strong> with the request sent by the browser. The server is working completely fine, but the user has made an error\u2014like typing a URL wrong, trying to access a page without logging in, or requesting something they aren&#8217;t allowed to see. Imagine Harry Potter sneaking into the <strong>Restricted Section<\/strong> of the Hogwarts Library at night. He doesn&#8217;t have a signed permission slip from a professor, and he&#8217;s looking for a book that shouldn&#8217;t be touched. Madam Pince catches him instantly, points a strict finger, and kicks him out. The library is perfectly intact, but Harry made a mistake by breaking the rules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are multiple <strong>4xx status codes<\/strong>, they are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>400 Bad Request<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server cannot understand the request because the <strong>syntax is garbled, corrupt, or missing vital information<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 400 Bad Request\nContent-Type: application\/json\n\n{\"error\": \"Malformed JSON payload. Missing closing bracket.\"}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>401 Unauthorized<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The requested page requires authentication. You must provide <strong>valid credentials<\/strong> (like a username and password) to see it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 401 Unauthorized\nWWW-Authenticate: Basic realm=\"Secure Admin Area\"<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>403 Forbidden<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server knows exactly who you are, but you absolutely do not have <strong>permission <\/strong>to view this resource. Unlike a <code>401<\/code>, logging in won&#8217;t help you here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 403 Forbidden\nContent-Type: text\/plain\n\nError: You do not have administrator privileges to access this directory.<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>404 Not Found<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The most famous code on the web. The server is running fine, but the <strong>specific file or URL path you requested simply does not exist<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 404 Not Found\nContent-Type: text\/html\n\n&lt;h1&gt;404: The page you are looking for has vanished into thin air.&lt;\/h1&gt;<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>405 Method Not Allowed<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The target URL exists, but it <strong>doesn&#8217;t accept the specific HTTP method you used<\/strong> (for example, trying to <code>POST<\/code> data to a static page that only allows <code>GET<\/code> requests).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 405 Method Not Allowed\nAllow: GET, HEAD<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>408 Request Timeout<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server <strong>got tired of waiting for the browser to finish sending its request <\/strong>and decided to close the connection to save resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 408 Request Timeout\nConnection: close<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>409 Conflict<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The request cannot be completed because it <strong>conflicts with the current state of the server<\/strong> (like trying to sign up with an email address that is already registered in the database).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 409 Conflict\nContent-Type: application\/json\n\n{\"error\": \"Username 'HarryPotter' is already taken.\"}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>410 Gone<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Similar to a <code>404<\/code>, but intentional. The resource used to be here, <strong>but it has been permanently deleted and will never come back<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 410 Gone\nConnection: close<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>415 Unsupported Media Type<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server refuses to process the request because the format of the <strong>data being sent isn&#8217;t supported<\/strong> (like trying to upload a <code>.txt<\/code> file to an image-only profile picture uploader).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 415 Unsupported Media Type\nAccept: image\/jpeg, image\/png<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>422 Unprocessable Entity<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The request syntax is completely correct, but the <strong>server cannot process the contained instructions because the data inside makes no logical sense <\/strong>(like trying to submit a form where your birth year is set to 2099).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 422 Unprocessable Entity\nContent-Type: application\/json\n\n{\"errors\": {\"age\": \"Age cannot be a negative number.\"}}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>429 Too Many Requests<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Rate limiting. The user has sent <strong>too many requests in a short window of time<\/strong>, and the server is blocking them temporarily to protect itself from crashing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 429 Too Many Requests\nRetry-After: 3600<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Fun Fact:<\/strong> There is a famous joke code in the official HTTP specifications: <strong>418 I&#8217;m a Teapot<\/strong>. It was created as an April Fools&#8217; joke in 1998 to show how a teapot should refuse an attempt to brew coffee, but it remains a real, valid code to this day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5XX: Server Error Responses-<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>5xx status codes<\/strong> mean that the client (the browser) did absolutely nothing wrong, but the server encountered a <strong>major internal glitch,<\/strong> <strong>crashed, or ran out of resources<\/strong> while trying to process the request. Imagine you throw down your Floo powder, step into the fireplace, and state your destination perfectly clearly. Suddenly, the entire magical grid glitches, green sparks shoot out wildly, and you get thrown out of the wrong grate into Knockturn Alley. It wasn\u2019t your fault, your pronunciation was flawless. The underlying magical network itself just suffered a system-wide crash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are multiple <strong>5xx status codes<\/strong>, they are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>500 Internal Server Error<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The generic &#8220;catch-all&#8221; error code for when the server encounters an <strong>unexpected condition or software bug<\/strong> that prevents it from fulfilling the request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 500 Internal Server Error\nContent-Type: application\/json\n\n{\"error\": \"NullPointerException: Database connection failed unexpectedly.\"}<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>502 Bad Gateway<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server you connected to was acting as a proxy or &#8220;middleman&#8221; gateway, and it r<strong>eceived an invalid, garbled response <\/strong>from the main backend server it tried to talk to.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 502 Bad Gateway\nContent-Type: text\/html\n\n&lt;h1&gt;502 Bad Gateway: Main application server did not respond correctly.&lt;\/h1&gt;<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>503 Service Unavailable<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">he server is currently incapable of handling the request. This is almost always a <strong>temporary state caused by the server being completely overloaded with too much traffic<\/strong> or being down for scheduled maintenance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 503 Service Unavailable\nRetry-After: 120<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>504 Gateway Timeout<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Like the 502 error, the server you hit was acting as a middleman. However, instead of getting a <em>bad<\/em> response from the backend, the backend <strong>took way too long to respond<\/strong>, and the gateway server ran out of patience and gave up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 504 Gateway Timeout\nConnection: close<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>505 HTTP Version Not Supported<\/strong><\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The server <strong>refuses <\/strong>to handle the request because it doesn&#8217;t support the <strong>specific version of the HTTP protocol <\/strong>that the browser used to send it (e.g., a very old legacy server trying to read a modern HTTP\/3 request).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>HTTP\/1.1 505 HTTP Version Not Supported<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next time you <strong>encounter a broken link or an unexpected glitch <\/strong>online, you don&#8217;t need a magic wand to figure out what went wrong. Just look at that little <strong>3-digit numbe<\/strong>r at the top of the screen. Whether it&#8217;s the server telling you everything went perfectly (<code>200 OK<\/code>), a moving staircase rerouting your path (<code>301 Moved Permanently<\/code>), Madam Pince kicking you out of the Restricted Section (<code>403 Forbidden<\/code>), or the Floo Network crashing entirely behind the scenes (<code>500 Internal Server Error<\/code>) etc, you can always check!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy coding, and may your browser never return a 500!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mischief Managed: A Harry Potter Guide to HTTP Response Codes Have you ever wondered what actually happens behind the scenes [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[20,46,36,44,38,47,45,37,13,41,48,39,35,40,42,43,19],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-http","tag-api","tag-articles","tag-backend","tag-blogging","tag-coding-humor","tag-codingisfun","tag-dev-community","tag-harry-potter","tag-http","tag-http-status-codes","tag-https","tag-learning","tag-programming","tag-software-engineering-2","tag-web-servers","tag-web-standards","tag-webdev"],"_links":{"self":[{"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":8,"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions\/146"}],"wp:attachment":[{"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.csfree.org\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}