gpt4 book ai didi

http - 使用符合 HTTP 协议(protocol)的任何 HTTP 方法时是否正在发送查询字符串?

转载 作者:可可西里 更新时间:2023-11-01 16:56:56 24 4
gpt4 key购买 nike

所有这些组合都符合 HTTP 标准吗?

GET /entities/?param=value HTTP/1.1
POST /entities/?param=value HTTP/1.1
PUT /entities/?param=value HTTP/1.1
DELETE /entities/?param=value HTTP/1.1
HEAD /entities/?param=value HTTP/1.1
PATCH /entities/?param=value HTTP/1.1

最佳答案

根据 the specification (正如我所读),它们是允许的。

这就是 Request-Line 的方式构造(就像你的例子中的那些):

5.1 Request-Line

The Request-Line begins with a method token, followed by the Request-URI and the protocol version, and ending with CRLF. The elements are separated by SP characters. No CR or LF is allowed except in the final CRLF sequence.

    Request-Line   = Method SP Request-URI SP HTTP-Version CRLF

然后 about Request-URI :

The Request-URI is a Uniform Resource Identifier (section 3.2) and identifies the resource upon which to apply the request.

在我看来,规范没有限制可以使用什么样的 URI,以及它们是否受到某些 Methods 的使用限制。 .

关于http - 使用符合 HTTP 协议(protocol)的任何 HTTP 方法时是否正在发送查询字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11433885/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com