QueryString / GET / URL参数的限制是什么 [英] What is the limit on QueryString / GET / URL parameters

查看:98
本文介绍了QueryString / GET / URL参数的限制是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

QueryString / GET / URL参数的限制

What is the limit on QueryString / GET / URL parameters

推荐答案

理论上没有限制。对于HTTP URL, HTTP 1.1规范声明:

There is no limit in theory. For HTTP URLs, the HTTP 1.1 specification states:


HTTP协议不对
a URI的长度设置任何先验限制。服务器必须能够处理它们所提供的任何资源的URI,并且如果它们是
提供可以生成这种URI的基于GET的表单,则应该能够处理无限长度的URI。如果URI比服务器可以处理的更长
,服务器
应该返回414(Request-URI Too Long)状态(参见第10.4.15节)。

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).

但实际上,许多客户端和服务器只支持一定长度的URL。 经验法则不允许使用超过2000个字符的网址(已编码百分比)考虑到了。)

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆