在URL空间;没有浏览器变得更加智能和服务器? [英] space in url; did browser got smarter or server?

查看:139
本文介绍了在URL空间;没有浏览器变得更加智能和服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来今天你不再需要在你的HTML链接或图片链接由20%都设有code空间。例如,假设你在〔http://example.com/i/my house.jpg〕这一形象。注意空间存在。在你的HTML code,你可以这样做:

It looks like today you no longer to have to encode spaces by %20 in your html links or image links. For example, suppose you have this image at 〔http://example.com/i/my house.jpg〕. Notice the space there. In your html code, you can just do this:

<img src="http://example.com/i/my house.jpg" alt="my house">

它工作在所有浏览器当前版本。虽然,有什么我不知道的是,无论是浏览器连接codeS其请求的URL,或者特定的服务器将做正确的与空间的路径前? (阿帕奇)

It work in all current version of browsers. Though, what i'm not sure is that whether the browser encodes it before requesting the url, or a particular server will do the right with with paths with space? (apache)

附录:
遗憾的混乱。我真正的问题是关于HTTP协议。
因为是和马克回答我将离开这一个。
我在这里发布了一个新的问题。
<一href=\"http://stackoverflow.com/questions/4673809/does-http-protocol-require-space-be-en$c$cd-in-file-path\">does HTTP协议需要空间的连接文件路径codeD?

推荐答案

浏览器发出的修正。

您还必须设有code的空间虽然。只是因为它在你使用不让它有效的浏览器,而并不意味着它会工作无处不在。

You still have to encode the spaces though. Just because it works in the browsers you use doesn't make it valid, and doesn't mean it will work everywhere.

您可以看到保留字符和其他字符的列表,这应该是连接这里codeD:的 http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

You can see a list of reserved characters and other characters that should be encoded here: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

RFC1738 明确规定:

因此​​,只有字母,数字,特殊字符$ -_。+!*'(),和
     用于各自保留目的的保留字符可以使用
     在URL中unen codeD。

Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.

RFC2396 发生在RFC1738和阐述了URL中的空间使用情况:

RFC2396 takes place over RFC1738 and expounds on space usage in URLs:

空格字符被排除在外,因为显著空间可能会
     消失,当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天全站免登陆