URL
Encoding in HTTP
HTTP URLs sent over the
internet using the ASCII character-set. In URL-encoding, the following things
are performed:
1. Convert all the "unsafe" characters to "%xx", where xx is the ASCII value of the character in hexadecimal.
2. All the spaces changes
into pluses.
3. String the name and value
together with = and &
Example
1.
name1=value1&name2=value2&name3=value3
4. For POST submission, the
string will be our message body, and for GET submission, the query string will
be our message body.
The ASCII symbols of the
characters and their replacements are shown in the following table. These
replacements of the symbol can be used in the URL before passing it to the
server:
Symbol |
ASCII |
Replacement |
Backspace |
08 |
%08 |
tab |
09 |
%09 |
linefeed |
10 |
%0A |
creturn |
13 |
%0D |
space |
32 |
%20 or + |
! |
33 |
%21 |
" |
34 |
%22 |
# |
35 |
%23 |
$ |
36 |
%24 |
% |
37 |
%25 |
& |
38 |
%26 |
' |
39 |
%27 |
( |
40 |
%28 |
) |
41 |
%29 |
* |
42 |
* |
+ |
43 |
%2B |
' |
44 |
%2C |
- |
45 |
- |
. |
46 |
. |
/ |
47 |
%2F |
0 |
48 |
0 |
1 |
49 |
1 |
2 |
50 |
2 |
3 |
51 |
3 |
4 |
52 |
4 |
5 |
53 |
5 |
6 |
54 |
6 |
7 |
55 |
7 |
8 |
56 |
8 |
9 |
57 |
9 |
: |
58 |
%3A |
; |
59 |
%3B |
< |
60 |
%3C |
= |
61 |
%3D |
> |
62 |
%3E |
? |
63 |
%3F |
@ |
64 |
%40 |
A |
65 |
A |
B |
66 |
B |
C |
67 |
C |
D |
68 |
D |
E |
69 |
E |
F |
70 |
F |
G |
71 |
G |
H |
72 |
H |
I |
73 |
I |
J |
74 |
J |
K |
75 |
K |
L |
76 |
L |
M |
77 |
M |
N |
78 |
N |
O |
79 |
O |
P |
80 |
P |
Q |
81 |
Q |
R |
82 |
R |
S |
83 |
S |
T |
84 |
T |
U |
85 |
U |
V |
86 |
V |
W |
87 |
W |
X |
88 |
X |
Y |
89 |
Y |
Z |
90 |
Z |
[ |
91 |
%5B |
\ |
92 |
%5C |
] |
93 |
%5D |
^ |
94 |
%5E |
_ |
95 |
_ |
. |
96 |
%60 |
a |
97 |
a |
b |
98 |
b |
c |
99 |
c |
d |
100 |
d |
e |
101 |
e |
f |
102 |
f |
g |
103 |
g |
h |
104 |
h |
i |
105 |
i |
j |
106 |
j |
k |
107 |
k |
l |
108 |
l |
m |
109 |
m |
n |
110 |
n |
o |
111 |
0 |
p |
112 |
p |
q |
113 |
q |
r |
114 |
r |
s |
115 |
s |
t |
116 |
t |
u |
117 |
u |
v |
118 |
v |
w |
119 |
w |
x |
120 |
x |
y |
121 |
y |
z |
122 |
z |
{ |
123 |
%7B |
| |
124 |
%7C |
} |
125 |
%7D |
~ |
126 |
%7E |
127 |
%7F |
|
> 127 |
Encode with "%xx", where "xx" is the ASCII
value of the character, in hexadecimal |
0 Comments