/Knowledge/sources/honojs__hono/llms-full/rpc-path-parameters-include-slashes--1595318ab32b.md
RPC: Path parameters > Include slashes - hono-docs
RPC: Path parameters Include slashes Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt include slashes S...
RPC: Path parameters > Include slashes
Source evidence: /Sources/honojs__hono/provenance.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
paramcontaining slashes using the hc function, the server might not route as intended. Encoding the parameters usingencodeURIComponentis the recommended approach to ensure correct routing.
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#include-slashes",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / RPC > Path parameters > Include slashes",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 55,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "RPC: Path parameters > Include slashes",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}