natep2234 commited on
Commit
e8ef5c7
·
verified ·
1 Parent(s): efee346

Upload http.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. http.html +54 -0
http.html ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>http.status — What does that status code mean?</title>
7
+ <style>
8
+ *{margin:0;padding:0;box-sizing:border-box}
9
+ body{background:#0d1117;color:#c9d1d9;font-family:-apple-system,'Segoe UI',monospace;min-height:100vh;padding:3rem 1rem;display:flex;flex-direction:column;align-items:center}
10
+ h1{font-size:2rem;color:#f0f6fc;margin-bottom:.25rem}
11
+ .sub{color:#484f58;margin-bottom:2rem}
12
+ .panel{width:100%;max-width:600px}
13
+ input{background:#161b22;border:1px solid #30363d;border-radius:6px;padding:.85rem 1rem;color:#f0f6fc;font-family:'Courier New',monospace;font-size:1.3rem;outline:none;width:100%;text-align:center;letter-spacing:.1em}
14
+ input:focus{border-color:#58a6ff}
15
+ .result{background:#161b22;border:1px solid #30363d;border-radius:8px;padding:1.5rem;margin-top:1.25rem;display:none}
16
+ .code{font-size:2rem;font-weight:bold;font-family:'Courier New',monospace}
17
+ .code.c1{color:#8b949e}.code.c2{color:#3fb950}.code.c3{color:#58a6ff}.code.c4{color:#d29922}.code.c5{color:#f85149}
18
+ .name{color:#f0f6fc;font-size:1.1rem;margin-top:.25rem}
19
+ .desc{color:#8b949e;margin-top:.75rem;line-height:1.6}
20
+ .cat{margin-top:.75rem;font-size:.85rem;padding:.3rem .6rem;border-radius:4px;display:inline-block}
21
+ .cat.c1{background:#1c2128;color:#8b949e}.cat.c2{background:#0d2818;color:#3fb950}.cat.c3{background:#0d1d32;color:#58a6ff}.cat.c4{background:#2d1f00;color:#d29922}.cat.c5{background:#2d1117;color:#f85149}
22
+ .common{margin-top:1rem;color:#484f58;font-size:.85rem;line-height:1.6}
23
+ .footer{margin-top:3rem;color:#30363d;font-size:.75rem}
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <h1>http.status</h1>
28
+ <p class="sub">Type a code. Get the answer.</p>
29
+ <div class="panel">
30
+ <input id="code" type="text" placeholder="404" maxlength="3" autofocus>
31
+ <div class="result" id="result"></div>
32
+ </div>
33
+ <div class="footer">Built by Atreus — dev.tools collection</div>
34
+ <script>
35
+ const S={100:["Continue","The server received the request headers; the client should proceed to send the body.","Initial part of request accepted"],101:["Switching Protocols","The server is switching protocols as requested by the client.","WebSocket upgrade"],200:["OK","The request succeeded. The meaning depends on the HTTP method used.","Standard success response"],201:["Created","The request succeeded and a new resource was created.","POST that creates something"],202:["Accepted","The request has been accepted for processing, but processing is not complete.","Async operations, queued jobs"],204:["No Content","The request succeeded but there is no content to send back.","DELETE success, PUT with no body needed"],301:["Moved Permanently","The resource has been permanently moved to a new URL.","Domain changes, HTTP→HTTPS redirect. Update your links."],302:["Found","The resource is temporarily at a different URL.","Temporary redirect. Don't update bookmarks."],304:["Not Modified","The resource hasn't changed since last request. Use your cached version.","Browser cache hit. If unexpected: clear cache."],307:["Temporary Redirect","Same as 302 but method and body must not change.","POST redirect that preserves the method"],308:["Permanent Redirect","Same as 301 but method and body must not change.","API versioning redirects"],400:["Bad Request","The server cannot process the request due to a client error.","Malformed JSON, missing required field, invalid parameter. Check your request body."],401:["Unauthorized","Authentication is required and has failed or not been provided.","Missing or expired token. Check Authorization header."],403:["Forbidden","The server understood the request but refuses to authorize it.","Valid auth but insufficient permissions. Check roles/scopes."],404:["Not Found","The server cannot find the requested resource.","Wrong URL, deleted resource, typo in path. Check the endpoint."],405:["Method Not Allowed","The HTTP method is not supported for this endpoint.","Using POST on a GET-only endpoint. Check API docs."],408:["Request Timeout","The server timed out waiting for the request.","Slow client, large upload, network issues."],409:["Conflict","The request conflicts with the current state of the resource.","Duplicate entry, version conflict, concurrent edit."],410:["Gone","The resource is no longer available and will not be available again.","Permanently deleted. Unlike 404, this is intentional."],413:["Payload Too Large","The request body exceeds the server's size limit.","File upload too big. Check server's max body size config."],415:["Unsupported Media Type","The server doesn't support the request's Content-Type.","Sending JSON but server expects form-data, or missing Content-Type header."],422:["Unprocessable Entity","The request was well-formed but semantically invalid.","Validation errors. The JSON is valid but the data doesn't make sense."],429:["Too Many Requests","Rate limit exceeded.","Slow down. Check Retry-After header. Implement exponential backoff."],500:["Internal Server Error","The server encountered an unexpected condition.","Bug in server code. Check server logs."],502:["Bad Gateway","The server acting as gateway got an invalid response from upstream.","Upstream server down or misconfigured. Check proxy/load balancer."],503:["Service Unavailable","The server is not ready to handle the request.","Server overloaded or under maintenance. Check Retry-After header."],504:["Gateway Timeout","The server acting as gateway didn't get a response in time from upstream.","Upstream server too slow. Increase timeout or fix upstream performance."]};
36
+ document.getElementById('code').addEventListener('input',function(){
37
+ const v=this.value.trim();
38
+ const el=document.getElementById('result');
39
+ if(!v||!/^\d{1,3}$/.test(v)){el.style.display='none';return;}
40
+ const n=parseInt(v);
41
+ if(n<100||n>599){el.style.display='none';return;}
42
+ const cat=Math.floor(n/100);
43
+ const catNames={1:'Informational',2:'Success',3:'Redirection',4:'Client Error',5:'Server Error'};
44
+ const info=S[n];
45
+ el.style.display='block';
46
+ if(info){
47
+ el.innerHTML=`<div class="code c${cat}">${n}</div><div class="name">${info[0]}</div><div class="cat c${cat}">${catNames[cat]}</div><div class="desc">${info[1]}</div><div class="common">Common cause: ${info[2]}</div>`;
48
+ } else {
49
+ el.innerHTML=`<div class="code c${cat}">${n}</div><div class="name">Unknown Status Code</div><div class="cat c${cat}">${catNames[cat]||'Unknown'}</div><div class="desc">This status code is not commonly used or is non-standard.</div>`;
50
+ }
51
+ });
52
+ </script>
53
+ </body>
54
+ </html>