/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-custom-response-2267684b66cf-custom-response-s0613-c0000.md
Custom Response - hono-docs
Custom Response Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt custom response Summary For other...
Custom Response
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#custom-response
Summary
For other response types, or to set response headers, use the res option. Note that the status passed to the constructor is the one used to create responses. ```ts twoslash import { HTTPException } from 'hono/http-exception' const er...
Content
For other response types, or to set response headers, use the res option. Note that the status passed to the constructor is the one used to create responses.
import { HTTPException } from 'hono/http-exception'
const errorResponse = new Response('Unauthorized', {
status: 401, // this gets ignored
headers: {
Authenticate: 'error="invalid_token"',
},
})
throw new HTTPException(401, { res: errorResponse })