URL方案/主机/路径中的“ +”是否表示空格? [英] Does a `+` in a URL scheme/host/path represent a space?

查看:62
本文介绍了URL方案/主机/路径中的“ +”是否表示空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道URL的查询字符串中的 + 代表一个空格。在查询字符串区域之外是否也是这种情况?也就是说,请执行以下URL:

I am aware that a + in the query string of a URL represents a space. Is this also the case outside of the query string region? That is to say, does the following URL:

http://a.com/a+b/c

实际上表示:

http://a.com/a b/c

(因此需要进行编码是( + ),还是实际上是 a + b / c ? p>

(and thus need to be encoded if it should actually be a +), or does it in fact actually represent a+b/c?

推荐答案


  • URL路径部分中的百分比编码应该被解码,但是

  • 路径组件中的任何 + 个字符都应按字面意义对待。

    • Percent encoding in the path section of a URL is expected to be decoded, but
    • any + characters in the path component is expected to be treated literally.
    • 要明确: + 只是查询组件中的特殊字符。

      To be explicit: + is only a special character in the query component.

      > https://tools.ietf.org/html/rfc3986

      这篇关于URL方案/主机/路径中的“ +”是否表示空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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