headers()

The async function from next/headers that returns the incoming request's HTTP headers for reading in Server Components.

In more detail

Calling it makes the route dynamic. In Next.js 15 it must be awaited. The returned headers are read-only.

Related terms

Taught in

References