不要对整个URL进行Component urlencode进行编码(比如在线工具,整个HTTP结构都搞乱了),常用于对参数进行编码。

urlencode可对整个url进行编码,但不会破坏HTTP的结构,因为它不会对“:”等字符进行编码。

自己尝试一下便知,千万别盲目用线上工具

urlencode Component urlencode 区别

具体可看大佬的小结:JS escape urlencodeComponent urlencode 区别

相关文章: