我可以在 url 的路径部分使用 at (@) 符号吗 [英] Can I use an at (@) sign in the path part of an url

查看:43
本文介绍了我可以在 url 的路径部分使用 at (@) 符号吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道它不能作为授权部分的一部分,因为在那里使用了带有 @ 的用户名,但我可以在路径部分使用它.

I know it can't be part of the authority section as usernames with an @ are used there, but can I use it in the path section.

我想使用它的原因是作为用户资源 url 的一部分.例如

The reason I want to use it is as part of an url for a users resources. eg

www.example.com/user@domain.com/someresource

www.example.com/user@domain.com/someresource

推荐答案

@ 符号是 中的保留字符RFC 3986 因此不允许在您的 URL 中使用.使用 URL 编码时会转换为 %40.

The @ symbol is a reserved character in RFC 3986 so it is not allowed in your URL. It would be converted to %40 when URL encoding is used.

这篇关于我可以在 url 的路径部分使用 at (@) 符号吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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