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

x/hono/mod.ts>HonoRequest#header

Web Framework built on Web Standards
Extremely Popular
Go to Latest
method HonoRequest.prototype.header
import { HonoRequest } from "https://deno.land/x/hono@v4.2.7/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>