Serving HTML and Markdown from One Public URL via Content Negotiation
A developer explains how a public web page can offer both HTML and Markdown representations at the same URL, using HTTP content negotiation. The example project, Giorgio, exposes a read-only public catalog endpoint that needs no account or API key. The author shows a standard-library Python client that sends an identifying User-Agent, noting that a default request was rejected with HTTP 403 by the edge layer. Markdown is returned when clients request text/markdown, with responses varying on Accept so caches can distinguish them, while private chat and code session routes stay outside this negotiation. The piece stresses that such interfaces only improve access to public information and do not guarantee indexing, recommendations, or training use.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in