online / endpoints 59 / categories 14 / rate 60/min/ip /

GET /status/{code}

GET /status/{code}

Returns the requested HTTP status code. Body is JSON describing the response, except for 204 and 304 which return no body per RFC 9110.

code HTTP status code. Range: 100–599. Some protocol-switching codes (e.g. 101) are rejected with a 400.
build a request:

expect: A JSON body summarizing the response status. 204 and 304 return empty bodies per RFC 9110.

bash
curl -i https://chaos.catastrophic.io/status/503
import urllib.request, urllib.error
try:
    resp = urllib.request.urlopen("https://chaos.catastrophic.io/status/503")
    print(resp.status, resp.reason)
except urllib.error.HTTPError as e:
    # non-2xx is raised, not returned
    print(e.code, e.reason)
// fetch does NOT throw on non-2xx — check status manually
const res = await fetch("https://chaos.catastrophic.io/status/503");
console.log(res.status, res.statusText);
package main

import (
    "fmt"
    "net/http"
)

func main() {
    // net/http does not throw on non-2xx — inspect StatusCode directly.
    resp, err := http.Get("https://chaos.catastrophic.io/status/503")
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    fmt.Println(resp.StatusCode, resp.Status)
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }
fn main() -> Result<(), Box> {
    let resp = reqwest::blocking::get("https://chaos.catastrophic.io/status/503")?;
    println!("{}", resp.status());
    Ok(())
}
// Java 11+ HttpClient. Non-2xx is returned, not thrown.
import java.net.URI;
import java.net.http.*;

public class Status {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var req = HttpRequest.newBuilder(URI.create("https://chaos.catastrophic.io/status/503")).build();
        var resp = client.send(req, HttpResponse.BodyHandlers.discarding());
        System.out.println(resp.statusCode());
    }
}
// .NET 6+. GetAsync does NOT throw on non-2xx — call EnsureSuccessStatusCode() if you want that.
using var client = new HttpClient();
var resp = await client.GetAsync("https://chaos.catastrophic.io/status/503");
Console.WriteLine($"{(int)resp.StatusCode} {resp.ReasonPhrase}");
require "net/http"
res = Net::HTTP.get_response(URI("https://chaos.catastrophic.io/status/503"))
puts "#{res.code} #{res.message}"
# PowerShell 5.1: Invoke-WebRequest throws on non-2xx.
# Wrap in try/catch to inspect the response.
try {
    $r = Invoke-WebRequest -Uri 'https://chaos.catastrophic.io/status/503'
} catch {
    $_.Exception.Response.StatusCode.value__
}