Skip to content

docs(routing): document the QUERY HTTP method - #89

Open
DavideCarvalho wants to merge 1 commit into
adonisjs:mainfrom
DavideCarvalho:docs/router-query-method
Open

DavideCarvalho wants to merge 1 commit into
adonisjs:mainfrom
DavideCarvalho:docs/router-query-method

Conversation

@DavideCarvalho

@DavideCarvalho DavideCarvalho commented Oct 16, 2026 •

Copy link
Copy Markdown

What

Documents the new router.query() shorthand from adonisjs/http-server#140.

  • content/guides/basics/routing.md: adds QUERY to the HTTP methods table and code sample, plus a short "The QUERY method" subsection that explains what the method is for, shows a route and a curl request, mentions that requests without a valid Content-Type are rejected with 400, and links to RFC 10008
  • content/guides/basics/body_parser.md: one sentence under allowedMethods pointing out that QUERY has to be in the list for its body to be parsed

Why

@thetutlage asked for docs to go with the http-server PR. Since QUERY is new, the section sums up how it differs from GET and POST (safe, idempotent and cacheable, with the query in the request body) and links to the spec for the details.

The bodyparser note matters because the starter kits set allowedMethods explicitly in config/bodyparser.ts. Even after adonisjs/bodyparser#86 adds QUERY to the default list, existing apps have to add it themselves.

Tests

Docs only. The :::note callout and the ./routing.md#the-query-method anchor follow the same patterns used elsewhere in content/guides. I didn't build the docs site locally, and the repo has no lint step for content/ (Prettier ignores *.md).

This should be merged once adonisjs/http-server#140 (and ideally adonisjs/bodyparser#86) is released.

🤖 Generated with Claude Code

Add router.query() to the HTTP methods section with a short summary of
what QUERY (RFC 10008) is for, a usage example, the Content-Type
requirement, and a note about adding QUERY to the bodyparser
allowedMethods.

Refs adonisjs/http-server#140

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant