HTTP QUERY 方法
摘要
本互联网草案定义了 HTTP QUERY 方法,这是一种安全且幂等的方法,允许请求处理封装的内容并返回结果,类似于 POST 但不会带来部分状态变更的风险。
<a href="https://lobste.rs/s/3orizi/http_query_method">评论</a>
查看缓存全文
缓存时间: 2026/06/25 00:03
# HTTP QUERY 方法
来源:https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html
Internet-Draft
HTTP QUERY 方法
2026年6月
Reschke 等人
有效期至 2026年12月25日
[页码]
## 摘要 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#abstract)
本规范定义了 HTTP 的 QUERY 方法。QUERY 请求要求请求目标以安全且幂等的方式处理所包含的内容,并返回处理结果作为响应。这与 POST 请求类似,但可以自动重复或重启,无需担心部分状态变更。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-abstract-1)
## 编者注 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-editorial-note)
此备注将在发布为 RFC 前删除。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-note.1-1)
有关本草案的讨论将在 HTTP 工作组邮件列表 ([email protected]) 上进行,存档地址为:
https://lists.w3.org/Archives/Public/ietf-http-wg/
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-note.1-2)
工作组信息请访问 https://httpwg.org/;本草案的源代码和问题列表请访问 https://github.com/httpwg/http-extensions/labels/query-method。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-note.1-3)
本草案的变更总结见附录 C.14 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#changes.since.13)。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-note.1-4)
## 本备忘录的状态 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-status-of-this-memo)
本 Internet-Draft 完全符合 BCP 78 和 BCP 79 的规定提交。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-boilerplate.1-1)
Internet-Drafts 是互联网工程任务组 (IETF) 的工作文档。请注意,其他组织也可能以 Internet-Drafts 形式发布工作文档。当前 Internet-Drafts 列表请访问 https://datatracker.ietf.org/drafts/current/。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-boilerplate.1-2)
Internet-Drafts 是有效期最长为六个月的草稿文档,可能随时被其他文档更新、替换或废弃。将 Internet-Drafts 用作参考材料或引用为“进行中的工作”之外的形式是不恰当的。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-boilerplate.1-3)
本 Internet-Draft 将于 2026 年 12 月 25 日到期。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-boilerplate.1-4)
## 版权声明 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-copyright-notice)
版权所有 © 2026 IETF Trust 及本文档作者。保留所有权利。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-boilerplate.2-1)
本文档受 BCP 78 及 IETF Trust 的《IETF 文档法律条款》(https://trustee.ietf.org/license-info) 约束,该条款在本文档发布之日生效。请仔细阅读这些文档,它们描述了您对本文档的权利和限制。从本文档提取的代码组件必须包含修订版 BSD 许可文本(详见《信托法律条款》第 4.e 节),并按修订版 BSD 许可的规定提供,不附带任何担保。
¶ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-boilerplate.2-2)
▲ (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#)
## 目录 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-table-of-contents)
- 1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-1). 引言 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-introduction)
- 1.1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-1.1). 术语 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-terminology)
- 1.2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-1.2). 表示惯例 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-notational-conventions)
- 2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2). QUERY (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-query)
- 2.1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.1). 媒体类型与内容协商 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-media-types-and-content-neg)
- 2.2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.2). 等价资源 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-equivalent-resource)
- 2.3 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.3). Content-Location 响应字段 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-content-location-response-f)
- 2.4 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.4). Location 响应字段 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-location-response-field)
- 2.5 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.5). 重定向 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-redirection)
- 2.6 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.6). 条件请求 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-conditional-requests)
- 2.7 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.7). 缓存 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-caching)
- 2.8 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-2.8). 范围请求 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-range-requests)
- 3 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-3). "Accept-Query" 头部字段 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-the-accept-query-header-fie)
- 4 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-4). 安全考虑 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-security-considerations)
- 5 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-5). IANA 考虑 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-iana-considerations)
- 5.1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-5.1). QUERY 方法的注册 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-registration-of-query-metho)
- 5.2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-5.2). Accept-Query 字段的注册 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-registration-of-accept-quer)
- 6 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-6). 规范性引用 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-normative-references)
- 7 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-7). 资料性引用 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-informative-references)
- 附录 A (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A). 示例 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-examples)
- A.1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.1). 简单查询 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-simple-query)
- A.2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.2). 发现 QUERY 支持 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-discovery-of-query-support)
- A.3 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.3). 发现 QUERY 格式 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-discovery-of-query-formats)
- A.4 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.4). Content-Location、Location 与间接响应 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-content-location-location-a)
- A.4.1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.4.1). 使用 Content-Location (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-using-content-location)
- A.4.2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.4.2). 使用 Location (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-using-location)
- A.4.3 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.4.3). 间接响应 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-indirect-responses)
- A.5 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.5). 条件请求 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-conditional-requests-2)
- A.6 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-A.6). 更多查询格式 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-more-query-formats)
- 附录 B (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-B). 方法名称 'QUERY' 的选择 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-selection-of-the-method-nam)
- 附录 C (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C). 变更日志 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-change-log)
- C.1 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.1). 自 draft-ietf-httpbis-safe-method-w-body-00 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-sa)
- C.2 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.2). 自 draft-ietf-httpbis-safe-method-w-body-01 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-saf)
- C.3 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.3). 自 draft-ietf-httpbis-safe-method-w-body-02 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe)
- C.4 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.4). 自 draft-ietf-httpbis-safe-method-w-body-03 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-)
- C.5 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.5). 自 draft-ietf-httpbis-safe-method-w-body-04 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-m)
- C.6 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.6). 自 draft-ietf-httpbis-safe-method-w-body-05 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-me)
- C.7 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.7). 自 draft-ietf-httpbis-safe-method-w-body-06 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-met)
- C.8 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.8). 自 draft-ietf-httpbis-safe-method-w-body-07 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-meth)
- C.9 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.9). 自 draft-ietf-httpbis-safe-method-w-body-08 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-metho)
- C.10 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.10). 自 draft-ietf-httpbis-safe-method-w-body-09 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-metho-2)
- C.11 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.11). 自 draft-ietf-httpbis-safe-method-w-body-10 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-metho-3)
- C.12 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.12). 自 draft-ietf-httpbis-safe-method-w-body-11 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-metho-4)
- C.13 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.13). 自 draft-ietf-httpbis-safe-method-w-body-12 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-metho-5)
- C.14 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-C.14). 自 draft-ietf-httpbis-safe-method-w-body-13 以来 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-since-draft-ietf-httpbis-safe-metho-6)
- 附录 D (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-D). 致谢 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-acknowledgements)
- 附录 E (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-E). 贡献者 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-contributors)
- 附录 F (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#appendix-F). 作者地址 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-authors-addresses)
## 1. (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#section-1) 引言 (https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html#name-introduction)
本规范定义了 HTTP QUERY 请求方法。
相似文章
RFC 10008: HTTP QUERY 方法
RFC 10008 定义了 HTTP QUERY 方法,这是一种安全且幂等的请求方法,允许在请求体中发送查询负载,弥合了 GET 和 POST 在查询操作之间的差距。
RFC 10008: HTTP QUERY 方法
RFC 10008 定义了新的 HTTP QUERY 方法,允许包含请求体的安全、幂等且可缓存的请求,解决了 GET 和 POST 在 RPC 风格 API 中的局限性。
新HTTP QUERY方法详解
文章解释了RFC 10008中定义的新HTTP QUERY方法,该方法通过提供一种标准、安全且幂等的带请求体方法,解决了GET和POST在复杂查询方面的限制。
Quack:DuckDB 的客户端-服务器协议
DuckDB 引入了名为“Quack”的全新客户端-服务器协议,使得 DuckDB 实例能够通过 HTTP 进行通信,在支持并发写入和远程访问的同时,保持简单性与高性能。
通过HTTP提供文件的三种方式:同步、epoll和io_uring
一篇技术文章,比较了通过HTTP提供文件的三种方法:同步的每个请求一个线程、基于epoll的异步I/O和io_uring,并附有C语言代码示例。