/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-manual-validator-78b974053630-manual-validator-s0101-c0001.md
Manual validator (2) - hono-docs
Manual validator (2) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt manual validator Summary Val...
Manual validator (2)
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#manual-validator
Summary
Validation targets include json, query, header, param and cookie in addition to form. ::: warning When you validate json or form, the request must contain a matching content-type header (e.g. `Content-Type: applicatio...
Content
Validation targets include json, query, header, param and cookie in addition to form.
::: warning
When you validate json or form, the request must contain a matching content-type header (e.g. Content-Type: application/json for json). Otherwise, the request body will not be parsed and you will receive an empty object ({}) as value in the callback.
It is important to set the content-type header when testing using
app.request().
Given an application like this.
const app = new Hono()
app.post(
'/testing',
validator('json', (value, c) => {
// pass-through validator
return value
}),
(c) => {
const body = c.req.valid('json')
return c.json(body)
}
)Your tests can be written like this.