GET /complete-stream
/partial-streamReturns a complete, well-formed JSON body — no early close. Counterpart to the chaos /partial-stream endpoint, which sends a Content-Type: application/json header and an opening JSON fragment, then closes mid-payload.
expect: 200 OK with Content-Type: application/json. Body is complete and closes cleanly — no truncation, no premature stream end.
curl -i 'https://not.catastrophic.io/complete-stream'
# See what JSON.parse would do with this:
curl -s 'https://not.catastrophic.io/complete-stream' | python -c "import sys, json; json.loads(sys.stdin.read())"
import json, urllib.request
raw = urllib.request.urlopen("https://not.catastrophic.io/complete-stream").read()
print(f"Got {len(raw)} bytes (HTTP layer is fine)")
try:
json.loads(raw)
except json.JSONDecodeError as e:
print(f"JSON parse failed (expected): {e.msg}")
const res = await fetch("https://not.catastrophic.io/complete-stream");
const text = await res.text();
console.log(`HTTP ${res.status}, ${text.length} bytes`);
try {
JSON.parse(text);
} catch (e) {
console.error("JSON parse failed (expected):", e.message);
}
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://not.catastrophic.io/complete-stream")
defer resp.Body.Close()
raw, _ := io.ReadAll(resp.Body)
fmt.Printf("HTTP %d, %d bytes\n", resp.StatusCode, len(raw))
var data any
if err := json.Unmarshal(raw, &data); err != nil {
fmt.Println("JSON parse failed (expected):", err)
}
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }
// serde_json = "1"
fn main() -> Result<(), Box> {
let resp = reqwest::blocking::get("https://not.catastrophic.io/complete-stream")?;
let status = resp.status();
let raw = resp.text()?;
println!("HTTP {status}, {} bytes", raw.len());
if let Err(e) = serde_json::from_str::(&raw) {
eprintln!("JSON parse failed (expected): {e}");
}
Ok(())
}
// Requires Jackson
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.net.http.*;
public class PartialStream {
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var req = HttpRequest.newBuilder(URI.create("https://not.catastrophic.io/complete-stream")).build();
var resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.printf("HTTP %d, %d bytes%n", resp.statusCode(), resp.body().length());
try {
new ObjectMapper().readTree(resp.body());
} catch (Exception e) {
System.err.println("JSON parse failed (expected): " + e.getMessage());
}
}
}
using System.Text.Json;
using var client = new HttpClient();
var resp = await client.GetAsync("https://not.catastrophic.io/complete-stream");
var raw = await resp.Content.ReadAsStringAsync();
Console.WriteLine($"HTTP {(int)resp.StatusCode}, {raw.Length} bytes");
try {
JsonDocument.Parse(raw);
} catch (JsonException e) {
Console.Error.WriteLine($"JSON parse failed (expected): {e.Message}");
}
require "net/http"
require "json"
res = Net::HTTP.get_response(URI("https://not.catastrophic.io/complete-stream"))
puts "HTTP #{res.code}, #{res.body.bytesize} bytes"
begin
JSON.parse(res.body)
rescue JSON::ParserError => e
puts "JSON parse failed (expected): #{e.message}"
end
$r = Invoke-WebRequest -Uri 'https://not.catastrophic.io/complete-stream'
$r.StatusCode # 200 — the HTTP layer is fine
try {
$r.Content | ConvertFrom-Json # this is where it breaks
} catch {
'JSON parse failed (expected)'
}
headers
body