Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hono/mod.ts>HonoRequest#header

Fast, Lightweight, Web-standards
Extremely Popular
Go to Latest
method HonoRequest.prototype.header
import { HonoRequest } from "https://deno.land/x/hono@v4.1.0/mod.ts";

.header() can get the request header value.

Examples

Example 1

app.get('/', (c) => {
  const userAgent = c.req.header('User-Agent')
})

Parameters

name: string

Returns

string | undefined

Returns

Record<string, string>