Support QUERY HTTP method #77390
TrevorBurnham
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
QUERY
method to be defined in the Next.js App RouterPOST
,PUT
, etc.GET
requests, but with the request body incorporated into the cache key.Non-Goals
QUERY
could potentially be useful for data-fetching with Server Actions, but that's beyond the scope of this request.Background
QUERY
is a new HTTP method that effectively works likeGET
with a body, solving the problem of content requests that require a large number of parameters.As of Node.js 22.2.0, the
QUERY
method is supported: nodejs/node#51562 (comment) However, exporting a function namedQUERY
from aroute.ts
in the App Router seems to be a no-op:QUERY
requests to that route receive a 400 error, and if that's the only export Next.js will log the warning "No HTTP methods exported in ".Proposal
I'd be interested in contributing this feature.
Beta Was this translation helpful? Give feedback.
All reactions