GET 参数中允许的字符 [英] Characters allowed in GET parameter

查看:23
本文介绍了GET 参数中允许的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GET 参数中允许哪些字符无需编码或转义?我的意思是这样的:

Which characters are allowed in GET parameters without encoding or escaping them? I mean something like this:

http://www.example.org/page.php?name=XYZ

除了 XYZ,还有什么?我认为只有以下字符:

What can you have there instead of XYZ? I think only the following characters:

  • a-z (A-Z)
  • 0-9
  • -
  • _

这是完整列表还是允许添加其他字符?

Is this the full list or are there additional characters allowed?

我希望你能帮助我.提前致谢!

I hope you can help me. Thanks in advance!

推荐答案

保留字符,具有保留意义,即分隔符 — :/?#[]@ — 和子分隔符 — !$&'()*+,;=

There are reserved characters, that have a reserved meanings, those are delimiters — :/?#[]@ — and subdelimiters — !$&'()*+,;=

还有一组字符称为非保留字符——字母数字和-._~——它们不被编码.

There is also a set of characters called unreserved characters — alphanumerics and -._~ — which are not to be encoded.

这意味着,任何不属于非保留字符集的内容都应该是 % 编码的,当它们没有特殊含义时(例如,作为 GET 参数).

That means, that anything that doesn't belong to unreserved characters set is supposed to be %-encoded, when they do not have special meaning (e.g. when passed as a part of GET parameter).

另请参阅RFC3986:统一资源标识符 (URI):通用语法

这篇关于GET 参数中允许的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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