/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-include-slashes-671dcb453d6b-include-slashes-s0055-c0000.md

Include slashes - hono-docs

Include slashes Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt include slashes Summary hc functi...

Include slashes

Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#include-slashes

Summary

hc function does not URL-encode the values of param. To include slashes in parameters, use regular expressions. ```ts // client.ts // Requests /posts/123/456 const res = await client.posts[':id'].$get({ pa...

Content

hc function does not URL-encode the values of param. To include slashes in parameters, use regular expressions.

// client.ts

// Requests /posts/123/456
const res = await client.posts[':id'].$get({
  param: {
    id: '123/456',
  },
})

// server.ts
const route = app.get(
  '/posts/:id{.+}',
  zValidator(
    'param',
    z.object({
      id: z.string(),
    })
  ),
  (c) => {
    // id: 123/456
    const { id } = c.req.valid('param')
    // ...
  }
)

[!NOTE] Basic path parameters without regular expressions do not match slashes. If you pass a param containing slashes using the hc function, the server might not route as intended. Encoding the parameters using encodeURIComponent is the recommended approach to ensure correct routing.

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-include-slashes-671dcb453d6b-include-slashes-s0055-c0000.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.