expressjs.com icon indicating copy to clipboard operation
expressjs.com copied to clipboard

Please Document the QUERY method

Open CxRes opened this issue 7 months ago • 6 comments

Description

Express already supports the QUERY method per expressjs/express#5615. Please add it to the documentation, for example, at https://expressjs.com/en/5x/api.html#routing-methods.

I would like to submit it to the list of implementation supporting the QUERY method at IETF/HTTPWG.

Expectations

Update https://expressjs.com/en/4x/api.html#routing-methods and https://expressjs.com/en/5x/api.html#routing-methods to include query.

CxRes avatar May 22 '25 20:05 CxRes

I believe we were waiting until it stabilized in Node.js. Also we support versions of node that do not have QUERY support so I thought we had discussed waiting on documentation until all versions supported it. cc @jonchurch

wesleytodd avatar May 22 '25 22:05 wesleytodd

Node has supported this since 21.7.2, and it has been backported 20.19.2 (look for llhttp 9.2.0 in the logs). It is probably never going to be ported to version 18. And you support it (with the appropriate Node version ofc).

The reason I had asked was because the QUERY method I-D has been sent to IESG for publication as a proposed standard (which is the last administrative stage for publishing a RFC). https://lists.w3.org/Archives/Public/ietf-http-wg/2025AprJun/0124.html

CxRes avatar May 23 '25 02:05 CxRes

We can definitely add a note saying that it's only supported in certain versions of Node.js, and I’d be in favor of that

bjohansebas avatar May 23 '25 23:05 bjohansebas

I also have a question about adding the method to the types declaration: https://github.com/expressjs/express/issues/5615#issuecomment-2943235410

RobinTail avatar Jun 05 '25 08:06 RobinTail

It is only stable in node@>=22. While it was added, it does not function correctly. We expose the methods Node.js has, but we have to specifically disable the tests for QUERY under node@22. If we are going to document it, we need to make it clear it does not work as expected when running in those version ranges. Not opposed to that comment in the docs, but as I said in the other thread, I think it might not yet be the best time to update the types.

wesleytodd avatar Jun 05 '25 15:06 wesleytodd

Either way, there's no rush to make the change. This method is still a draft even though Node.js has implemented it, so it's also preferable to wait until it is no longer a draft and becomes part of the official HTTP specification

bjohansebas avatar Jun 06 '25 01:06 bjohansebas