/Knowledge/sources/honojs__hono/llms-full/validation-manual-validator--part-02--c2a51d2ddbac.md
Validation: Manual validator (part 02) - hono-docs
Validation: Manual validator (part 02) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt manual validato...
Validation: Manual validator (part 02)
Source evidence: /Sources/honojs__hono/provenance.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.
Metadata
{
"chunk_index": 1,
"citation": "https://hono.dev/llms-full.txt#manual-validator",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Validation > Manual validator (2)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 101,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Validation: Manual validator (part 02)",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}