explaingit

for-get/http-decision-diagram

Analysis updated 2026-07-03

3,749JavaScriptAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A visual flowchart that maps out exactly which HTTP status code a server should return and why, following the official HTTP specifications step by step, with companion diagrams for caching decisions.

Mindmap

mindmap
  root((http-decision-diagram))
    What it does
      HTTP status code flowchart
      RFC 7230-7235 reference
      Caching decision diagrams
    Formats
      PNG and SVG visual
      JSON for code use
      Cosmogol source
    Use Cases
      Server development
      API debugging
      Test suite validation
    Topics
      Status code selection
      Cache storage rules
      Cache serving rules
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Look up the correct sequence of checks a server must perform before returning a 304 Not Modified response

USE CASE 2

Debug an API returning the wrong HTTP status code by tracing through the decision diagram step by step

USE CASE 3

Embed the JSON export of the diagram in an automated test suite to validate that your server returns the right status codes

What is it built with?

JavaScriptCosmogolSVG

How does it compare?

for-get/http-decision-diagramexperience-monks/devtoolfomantic/fomantic-ui
Stars3,7493,7483,750
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasymoderateeasy
Complexity1/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

No installation needed, download the PNG or SVG for immediate use as a reference diagram.

Use freely for any purpose, including commercial, as long as you preserve the copyright and license notice.

In plain English

When a web server responds to a browser or app request, it sends back a status code like 200 (success), 404 (not found), or 304 (use your cached copy). Choosing the right status code, and setting the right combination of headers to go with it, requires following a long chain of rules defined in the HTTP specification. This project makes that decision chain visible as a flowchart. The http-decision-diagram repository contains an activity diagram that maps out exactly how a server should determine which HTTP response code to send, step by step, based on the request it received and the headers involved. The diagram follows the official HTTP specifications (RFC7230 through RFC7235) and is meant as a reference for developers building or debugging HTTP servers and APIs. The diagram is available in visual formats (PNG, JPEG, SVG) for easy reading and in JSON format for use in code. The source is written in a format called Cosmogol, which is a language for describing finite state machines. The project also includes two companion diagrams specifically for HTTP caching: one for deciding whether to store a response in cache, and another for deciding whether to serve a cached response to an incoming request. The project is part of a broader initiative called for-GET HTTP, which aims to produce well-documented, specification-faithful tools for working with the HTTP protocol. The README is brief, but it links to fuller documentation in a separate doc folder. The license is Apache 2.0.

Copy-paste prompts

Prompt 1
Using the http-decision-diagram flowchart, walk me through every check a REST API server must perform before choosing between 200 OK and 304 Not Modified.
Prompt 2
My API keeps returning 200 when it should return 412. Help me trace through the http-decision-diagram to find where my server logic goes wrong.
Prompt 3
How do I use the JSON format of http-decision-diagram in a Node.js test to verify my Express server returns the correct HTTP status codes for different request scenarios?
Prompt 4
Explain the two HTTP caching decision diagrams in this repo: when should a server store a response in cache vs when should it serve a cached response to a new request?

Frequently asked questions

What is http-decision-diagram?

A visual flowchart that maps out exactly which HTTP status code a server should return and why, following the official HTTP specifications step by step, with companion diagrams for caching decisions.

What language is http-decision-diagram written in?

Mainly JavaScript. The stack also includes JavaScript, Cosmogol, SVG.

What license does http-decision-diagram use?

Use freely for any purpose, including commercial, as long as you preserve the copyright and license notice.

How hard is http-decision-diagram to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is http-decision-diagram for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub for-get on gitmyhub

Verify against the repo before relying on details.