URL 是请求大小的一部分吗?
Is URL a part of request size?
只是想知道 URL,什么可以是非常大的 (source),是否被计为 HTTP 请求大小的一部分,因为它的值被发送到服务器(特别是带有查询字符串)?
是的,请求的目标是发送到服务器的消息的一部分:
GET /hello.txt HTTP/1.1
Host: example.com
Accept: text/plain
来自 RFC 7230,它定义了 HTTP/1.1 协议的消息语法和路由:
A request-line begins with a method token, followed by a single space
(SP), the request-target, another single space (SP), the protocol
version, and ends with CRLF. [...]
HTTP does not place a predefined limit on the length of a request-line [...]
A server that receives a request-target longer than any URI it wishes to parse MUST respond with a 414
(URI Too Long) status code [...]
Various ad hoc limitations on request-line length are found in practice. It is RECOMMENDED that all HTTP senders and recipients support, at a minimum, request-line lengths of 8000 octets.
只是想知道 URL,什么可以是非常大的 (source),是否被计为 HTTP 请求大小的一部分,因为它的值被发送到服务器(特别是带有查询字符串)?
是的,请求的目标是发送到服务器的消息的一部分:
GET /hello.txt HTTP/1.1
Host: example.com
Accept: text/plain
来自 RFC 7230,它定义了 HTTP/1.1 协议的消息语法和路由:
A request-line begins with a method token, followed by a single space (SP), the request-target, another single space (SP), the protocol version, and ends with CRLF. [...]
HTTP does not place a predefined limit on the length of a request-line [...]
A server that receives a request-target longer than any URI it wishes to parse MUST respond with a
414
(URI Too Long) status code [...]Various ad hoc limitations on request-line length are found in practice. It is RECOMMENDED that all HTTP senders and recipients support, at a minimum, request-line lengths of 8000 octets.