QueryString/GET/URL 参数的限制是什么 [英] What is the limit on QueryString / GET / URL parameters
问题描述
QueryString/GET/URL 参数的限制是什么
理论上没有限制.对于 HTTP 网址,HTTP 1.1 规范指出:><块引用>
HTTP 协议对长度没有任何先验限制一个 URI.服务器必须能够处理它们所访问的任何资源的 URI服务,并且应该能够处理无限长度的 URI,如果它们提供可以生成此类 URI 的基于 GET 的表单.服务器如果 URI 更长,应该返回 414(Request-URI Too Long)状态比服务器可以处理的要多(参见第 10.4.15 节).
但实际上,许多客户端和服务器只支持特定长度的 URL.经验法则不是使用超过 2000 个字符的网址(已考虑百分比编码).
What is the limit on QueryString / GET / URL parameters
There is no limit in theory. For HTTP URLs, the HTTP 1.1 specification states:
The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).
But in practice, many clients and servers do only support URLs up to a certain length. The rule of thumb is not to use URLs longer than 2000 characters (percent encoding already taken into account).
这篇关于QueryString/GET/URL 参数的限制是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!