Repository navigation
docs(routing): document the QUERY HTTP method - #89
Open
DavideCarvalho wants to merge 1 commit into
Open
DavideCarvalho wants to merge 1 commit into
DavideCarvalho wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Documents the new
router.query()shorthand from adonisjs/http-server#140.content/guides/basics/routing.md: addsQUERYto 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 acurlrequest, mentions that requests without a validContent-Typeare rejected with400, and links to RFC 10008content/guides/basics/body_parser.md: one sentence underallowedMethodspointing out thatQUERYhas to be in the list for its body to be parsedWhy
@thetutlage asked for docs to go with the http-server PR. Since
QUERYis new, the section sums up how it differs fromGETandPOST(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
allowedMethodsexplicitly inconfig/bodyparser.ts. Even after adonisjs/bodyparser#86 addsQUERYto the default list, existing apps have to add it themselves.Tests
Docs only. The
:::notecallout and the./routing.md#the-query-methodanchor follow the same patterns used elsewhere incontent/guides. I didn't build the docs site locally, and the repo has no lint step forcontent/(Prettier ignores*.md).This should be merged once adonisjs/http-server#140 (and ideally adonisjs/bodyparser#86) is released.
🤖 Generated with Claude Code