为什么需要对 URL 进行编码? [英] Why do you need to encode URLs?

查看:43
本文介绍了为什么需要对 URL 进行编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么需要对网址进行编码?是否有充分的理由将 GET 数据中的每个空格更改为 %20?

Why do you need to encode urls? Is there a good reason why you have to change every space in the GET data to %20?

推荐答案

来自 RFC 2936,第 2.4.3 节:

From RFC 2936, section 2.4.3:

排除空格字符因为重要的空间可能消失,无关紧要的空间可能在 URI 转录时引入或排版或受文字处理的处理程式.空格也用于在许多上下文中分隔 URI.

The space character is excluded because significant spaces may disappear and insignificant spaces may be introduced when URI are transcribed or typeset or subjected to the treatment of word- processing programs. Whitespace is also used to delimit URI in many contexts.

这篇关于为什么需要对 URL 进行编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆