Cloudflare Fundamentals - JSON responses and RFC 9457 support for Cloudflare 1xxx errors
3mo ago
Source
CloudflareCloudflare Fundamentals - JSON responses and RFC 9457 support for Cloudflare 1xxx errorscloudflare.comCloudflare-generated 1xxx errors now return structured JSON when clients send Accept: application/json or Accept: application/problem+json . JSON responses follow RFC 9457 (Problem Details for HTTP APIs) , so any HTTP client that understands Problem Details can parse the base members without Cloudflare-specific code. Breaking change The Markdown frontmatter field http_status has been renamed to status . Agents consuming Markdown frontmatter should update parsers accordingly. Changes JSON format. Clients sending Accept: application/json or Accept: application/problem+json now receive a structured JSON object with the same operational fields as Markdown frontmatter, plus RFC 9457 standard members. RFC 9457 standard members (JSON only): type — URI pointing to Cloudflare documentation for the specific error code status — HTTP status code (matching the response status) title — short, human-readable summary detail — human-readable explanation specific to this occurrence instance — Ray ID identifying this specific error occurrence Field renames: http_status -> status (JSON and Markdown) what_happened -> detail (JSON only — Markdown prose sections are unchanged) Content-Type mirroring. Clients sending Accept: application/problem+json receive Content-Type: application/problem+json; charset=utf-8 back; Accept: application/json receives application/json; charset=utf-8 . Same body in both cases. Negotiation behavior Request header sent Response format Accept: application/json JSON ( application/json content type) Accept: application/problem+json JSON ( application/problem+json content type) Accept: application/json, text/markdown;q=0.9 JSON Accept: text/markdown Markdown Accept: text/markdown, application/json Markdown (equal q , first-listed wins) Accept: */* HTML (default) Availability Available now for Cloudflare-generated 1xxx errors. Get started curl -s --compressed -H "Accept: application/json" -A "TestAgent/1.0" -H "Accept-Encoding: gzip, deflate" "/cdn-cgi/error/1015"
You might also wanna read
Cloudflare Error 521: Web Server Connection Failure
This appears to be a Cloudflare error page notification indicating that a web server is down with error code 521. The content shows status i
shaun.nz·8mo ago

Cloudflare Error 522: Connection to www.johndcook.com Timed Out
This is not a traditional article but rather a Cloudflare error page indicating that the connection to www.johndcook.com timed out (Error 52

Comments
Sign in to join the conversation.
No comments yet. Be the first.