Route Handlers can return a plain Response, not just NextResponse

TIL you don't need NextResponse for a simple Route Handler — a standard Web API Response works fine, which matters for things like hand-rolled RSS/XML endpoints.

1 min read

Sabin Shrestha

Full-Stack Developer — Next.js, React & React Native

Today I learned that an App Router Route Handler doesn't require NextResponse — a plain, standard Response works fine for anything that doesn't need Next-specific extras (cookies helpers, rewrites, etc.).

app/rss.xml/route.ts
export function GET() {
  const xml = `<?xml version="1.0"?><rss>...</rss>`;
 
  return new Response(xml, {
    headers: { "Content-Type": "application/xml; charset=utf-8" },
  });
}

This is obvious in hindsight — Route Handlers are built on the Web platform's Request/Response primitives, and NextResponse is just a convenience subclass — but I'd been reaching for NextResponse.json() out of habit even for a hand-rolled XML feed, where it doesn't add anything.

Tip

NextResponse earns its keep when you need .cookies, .rewrite(), or .redirect(). For a static XML/plain-text response like an RSS feed, a bare Response is one less import.

© 2026 Sabin Shrestha