📅  最后修改于: 2021-01-03 03:10:40             🧑  作者: Mango
使用ASCII字符集通过Internet发送的HTTP URL。在URL编码中,执行以下操作:
1.将所有“不安全”字符转换为“%xx”,其中xx是十六进制字符的ASCII值。
2.所有空格变为加号。
3.将名称和值与=和&一起输入字符串
例
name1=value1&name2=value2&name3=value3
4.对于POST提交,该字符串将成为我们的消息正文,对于GET提交,该查询字符串将成为我们的消息正文。
下表显示了字符的ASCII符号及其替换。在将符号传递到服务器之前,可以在URL中使用这些符号的替换:
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 |