Skip to content

docs: add app.query() method to API documentation#2414

Open
GroophyLifefor wants to merge 4 commits into
expressjs:mainfrom
GroophyLifefor:query-docs
Open

docs: add app.query() method to API documentation#2414
GroophyLifefor wants to merge 4 commits into
expressjs:mainfrom
GroophyLifefor:query-docs

Conversation

@GroophyLifefor

Copy link
Copy Markdown
Member

Add app.query() documentation to Application API

Documents the new app.query() route method for handling HTTP QUERY requests (RFC 10008), a usage example, and an info alert noting the method was standardized on June 15, 2026 (Fresh Method).

@GroophyLifefor GroophyLifefor requested a review from a team as a code owner June 28, 2026 22:32
@netlify

netlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 6e98eb6
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6a41a7255de99700085d6ba8
😎 Deploy Preview https://deploy-preview-2414--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@GroophyLifefor GroophyLifefor self-assigned this Jun 28, 2026
@GroophyLifefor GroophyLifefor added the 5.x Docs for 5.x version label Jun 28, 2026
Comment thread src/content/api/5x/api/application/index.mdx
Comment thread src/content/docs/zh-cn/5x/guide/routing.mdx
Comment thread src/content/api/5x/api/application/index.mdx

@krzysdz krzysdz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All supported methods are listed in app.METHOD() section and I can't see it modified here. If someone checked the docs for router, they would be directed to the table in app.METHOD() for the list of supported methods.

BTW. HEAD, OPTIONS and PATCH, which AFAIK also are a part of the HTTP standard do not have their own sections in app (like DELETE, GET, POST, PUT do)

@GroophyLifefor

Copy link
Copy Markdown
Member Author

All supported methods are listed in app.METHOD() section and I can't see it modified here. If someone checked the docs for router, they would be directed to the table in app.METHOD() for the list of supported methods.

BTW. HEAD, OPTIONS and PATCH, which AFAIK also are a part of the HTTP standard do not have their own sections in app (like DELETE, GET, POST, PUT do)

I didn't add it there on purpose because I created a new section for query, if I hadn't created a section, I would have just added query to the list there.

@bjohansebas

Copy link
Copy Markdown
Member

I think having a separate section makes sense. I say that because it's essentially a combination of POST and GET in some ways, and this is also a case where we should educate developers. Many people don't know it exists, so it's a good addition for the query use case. It also helps distinguish it from Express 4, which, as far as I know, doesn't support it.

@bjohansebas

Copy link
Copy Markdown
Member

I didn't add it there on purpose because I created a new section for query, if I hadn't created a section, I would have just added query to the list there.

Also, add it to that table

@krzysdz

krzysdz commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

It also helps distinguish it from Express 4, which, as far as I know, doesn't support it.

I think that it does. The support depends only on Node.js version if I remember this correctly.

EDIT: QUERY test changes in 4.x expressjs/express#6513

@bjohansebas

bjohansebas commented Jun 28, 2026

Copy link
Copy Markdown
Member

I think that it does. The support depends only on Node.js version if I remember this correctly

To be honest, I never tested it. But unless the methods package was updated, then we would have support

Lol, it's been too long. My memory does fail sometimes 😂

@GroophyLifefor

GroophyLifefor commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

It also helps distinguish it from Express 4, which, as far as I know, doesn't support it.

I think that it does. The support depends only on Node.js version if I remember this correctly.

EDIT: QUERY test changes in 4.x expressjs/express#6513

from my research, in v4, uses "methods" npm package line 18, and list of that http methods not includes "query" index.js

edit: at the end, v4 should not support it, but not tested
2n edit: tested with empty project and looks working

@krzysdz

krzysdz commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

unless the methods package was updated, then we would have support

It uses whatever Node.js lists in http.METHODS or if http.METHODS does not exist (pre 0.11.9) it defaults to a hardcoded list:

https://github.com/jshttp/methods/blob/f89e491ab3f2a1e8c418648b890da2e96ef15edb/index.js#L22-L33

@bjohansebas

Copy link
Copy Markdown
Member

In that case, it looks like we do have support in Express 4 after all. Would you like to update its documentation as well?

@GroophyLifefor

Copy link
Copy Markdown
Member Author

In that case, it looks like we do have support in Express 4 after all. Would you like to update its documentation as well?

I think it would be best if you made the decision on this. If you decide, I can make the updates quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.x Docs for 5.x version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants