/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.

Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-manual-validator-78b974053630-manual-validator-s0101-c0001.md
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.