TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Is anyone making use of the HTTP QUERY verb?

10 点作者 johnhenry8 个月前

3 条评论

mlhpdx8 个月前
Oh, yes — I commonly use it in API designs (though I’m not checking on the RFC to see if I’m aligned with it). The QUERY verb is standard on any collection resource and acts like a filtered GET, taking a payload and returning the same response signature as GET.<p>I don’t (haven’t yet) worked with etags for QUERY, but have been using Prefer respond-async to implement async queries for large sets (and do paging of them with Range requests).<p>The “stay within the lines” way of designing APIs is getting a bit long of tooth in my opinion.
cdaringe8 个月前
* QUERY is non destructive&#x2F;idempotent. Hmmm. Bye bye UPDATE FOO set values(x=z) where id = foo. Seems limiting. * All existing methods for userland data exchange are CRUD adjacent (options&#x2F;connect&#x2F;etc are more protocoly). QUERY is a bit of an outlier. Im not against having a bulk “R”ead operation, but its kind of already GET, just suffers the payload problems mentioned.<p>How about GET &#x2F;foo -H x-query: serialized_query instead?
jonahbenton8 个月前
Have definitely needed it!<p>Looks like it might move forward<p><a href="https:&#x2F;&#x2F;httpwg.org&#x2F;http-extensions&#x2F;draft-ietf-httpbis-safe-method-w-body.html" rel="nofollow">https:&#x2F;&#x2F;httpwg.org&#x2F;http-extensions&#x2F;draft-ietf-httpbis-safe-m...</a>