获取请求中的参数可以持续多长时间? [英] How long may parameters in a get request be?

查看:103
本文介绍了获取请求中的参数可以持续多长时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在编程一个API,该API通过get参数获取传递的数据,所以我想知道URL的总长度或参数值的长度是否受到最佳实践或协议的限制.

I am currently programming an API that gets passed data via get parameters so I was wondering if the total length of the URL or of the parameters value is limited in best practice or by the protocol.

推荐答案

基本上,2K是跨浏览器方式最值得信赖的,但是如果您放弃对IE 8及更低版本的支持,您可能会喜欢64K.

Basically, 2K is the most you can rely on in a cross-browser fashion, but if you drop support for IE 8 and below, you can get to like 64K.

尽管我觉得我需要质疑您是否需要知道这一点,但所有内容都可以说..最好通过POST请求而不是GET处理100个字符.

Although I feel I need to question your need to know this, anything over say.. 100 characters would best be handled through a POST request instead of a GET.

这篇关于获取请求中的参数可以持续多长时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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