与百分比编码的 URL 等效 [英] Equivalency with percent-encoded URLs

查看:63
本文介绍了与百分比编码的 URL 等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下两个 URL:

Consider the following two URLs:

  1. https://www.google.com/search?q=foo
  2. https://www.google.com/search%3Fq%3Dfoo

据我所知,第二个是百分比编码版本第一个,但它返回一个错误.为什么?

To my knowledge, the second one is the percent-encoded version of the first one, but it returns an error. Why?

这两个 URL 在技术上是否与 RFC-3986 相同?网络服务器可以/应该选择使它们等效还是违反标准?

Aren't these two URLs technically equivalent as per RFC-3986? Could / should a web server choose to make them equivalent or would that go against the standard?

推荐答案

不,它们不是.问号在转义时将失去它原本具有的特殊含义.

No, they are not. The question mark, when escaped, will lose the special meaning it has otherwise.

这篇关于与百分比编码的 URL 等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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