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

x/hono/request.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.3.6/request.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>