Content Negotiation
# Prompt: `Accept: text/markdown` content negotiation
**File:** Server / middleware behavior on every page URL · **Status:** ✅ Standard HTTP · ⚠️ AI tool adoption uneven · **Time to ship:** 30 min to 2 hr depending on stack
Same URL, two representations. When a client sends `Accept: text/markdown`, your server returns the clean markdown variant. When the same URL is requested with the default `Accept: text/html`, it returns the HTML page. The variant is selected by the request's `Accept` header, declared back to caches via `Vary: Accept`.
Claude Code, Cursor, and several other coding assistants already send `Accept: text/markdown` as their preferred content type. Content negotiation is the technique most likely to become the long-term standard, because it's just standard HTTP doing what HTTP was designed for. It's the same mechanism that serves JSON vs. HTML from the same URL.
Prerequisite: you need clean markdown content available for each page. Either ship [`.md` page routes](md-routes.md) first and have content negotiation rewrite to them internally, or generate markdown on-the-fly in the handler.
---
## Copy this promptwhen to use it
Community prompt sourced from the open-source GitHub repo tristandenyer/awesome-ai-website-files (NOASSERTION). A "Content Negotiation" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
tristandenyer/awesome-ai-website-files · NOASSERTION