Query string
Appearance
A query string is the part of a URL that conveys parametric data to the server.
Syntax
The basic syntax is ?parameter1=value1¶meter2=value2 . . .
- The query string starts with a question mark.
- Then follows a series of parameter=value pairs. For example, Message=hello.
- The parameter-value pairs are each separated by an equal sign.
- The series of pairs is separated by the ampersand, '&'.
Spaces, ampersands, equal signs, and many other characters could cause trouble with the URL and the query string. Therefore the value in each parameter-value pair is URL-Encoded. This is a process by which each of these troublesome characters is converted into a numeric represenctation.
'%2D' is one such example.
- The percent sign signals the start of such a string.
- '2D' is the number 45 in HEX - in ASCII and UNICODE, each character has a numerical index.
Therefore, %2D is the minus sign, and %25 is the percent character.
- Spaces are converted to plus signs, e.g. "hello there" would be converted to "hello+there".
xxx
See also
External links
- online encoders and decoders for educational purposes