Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Characters allowed in GET parameter

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

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!

like image 781
caw Avatar asked Sep 21 '09 16:09

caw


People also ask

What characters are allowed in URL parameters?

In essence this means that the only characters you can reliably use for the actual name parts of a URL are a-z , A-Z , 0-9 , - , . , _ , and ~ . Any other characters need to be Percent encoded.

What characters are allowed in a query string?

The query component is a string of information to be interpreted by the resource. Within a query component, the characters ";", "/", "?", ":", "@", "&", "=", "+", ",", and "$" are reserved.


1 Answers

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.

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

See also RFC3986: Uniform Resource Identifier (URI): Generic Syntax

like image 57
Michael Krelin - hacker Avatar answered Oct 13 '22 13:10

Michael Krelin - hacker