完整可能的 URL 语法和语法 [英] Full Possible URL syntax and grammar

查看:21
本文介绍了完整可能的 URL 语法和语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看有关 URL 组件的一些信息,但找不到对可能的全长 url 以及每个组件可能是什么的合理解释.我想知道一个完整的 URL 会是什么样子,利用所有的复杂性.我也希望在我更好地理解它们后构建一个小图形用户界面来帮助解释它们,但在那之前我会尝试使用我知道的组件:

I was reviewing some information about the components of the URL, but can't find a reasonable explanation of the the possible full length url and what each component could be. I want to know what a full URL could look like, taking advantage of all of the intricasies. i will also hope to build a little GUI helping explain them once I undderstand them better, but until then I would try with the components I am aware of:

[ ] 括号包含一个完整的组件| 管道显示组件可能的子组件( ) 括号包含关于子/组件的注释、想法和假设

[ ] Brackets contain a full component | Pipe shows possible subcomponents of a component ( ) Parenthesis contain notes, thoughts, and assumptions about the sub/components

我的理解:

[type][://][subdomain][domain][port][path][file][query][hash]

这里是每个组件的描述:如果它有一个*,它是可选的

Here are the descriptions of each component: if it has an *, it is optional

[type]* = [ (type {http | https | ftp | file | etc...}) ](虽然这是可选的,但我相信它也是必需的,这意味着现代浏览器插入类型以向服务器请求它,服务器也可能返回不同的类型)

[type]* = [ (type {http | https | ftp | file | etc...}) ] (although this is optional, I believe that it is also required, meaning that modern browsers insert the type to request it to the server, and the server may return a different type as well)

[://] =(不知道这个叫什么)

[://] = (don't know what this is called)

[子域]* = [ [子域] |[子域]子域]

[subdomain]* = [ [subdomain] | [subdomain]subdomain ]

[domain] = [ 名称 .(输入 {com | org | 等..})]

[domain] = [ name . (type {com | org | etc..}) ]

[port]* = [(空白,默认端口:80)|端口:** ]

[port]* = [ (blank which is by default port:80) | port:** ]

[path]* = [ (空白) |[路径] |[路径]路径]

[path]* = [ (blank) | [path] | [path]path ]

[file] = [ 名称 .(输入 {html | php | php | (etc...) }) ]

[file] = [ name . (type {html | php | php | (etc...) }) ]

[query]* = [ ?[ 空白(即没有查询)|参数=值|paramater=value&paramater=value(etc...) ]]

[query]* = [ ?[ blank(ie no query) | paramater=value | paramater=value&paramater=value(etc...) ]]

[hash]* = [ #[ 空白(即没有哈希)|anyStringToBeParsedClientSide(通常用于持久性)](刚刚学习的哈希值也称为 片段标识符 )

[hash]* = [ #[ blank(ie no hash) | anyStringToBeParsedClientSide(usually for persistence) ] ( just learned a hash is also known as a fragment identifier )

我还忘记了什么,或者我是否忽略了一个解释它们的好网站.请更正我的命名,因为它们可能不正确,因为我也在尝试了解它们的名称.

What else am I forgetting, or am I overlooking a good site that explains them. Please correct my naming, as they are likely incorrect, as I am trying to also learn what they are called.

推荐答案

如果您真的想要所有错综复杂的内容,标准文档是唯一的出路,并且学习查找和阅读它们绝对是值得的.而且 RFC 通常不难阅读.

If you really want all the intricacies, standards documents are the only way to go, and learning to find and read them definitely pays off. And RFC's aren't typically very hard to read.

在这种情况下,RFC 1738(统一资源定位符) 是您想要的资源.它并不比你目前提出的更过于技术化";事实上,第 5 节的正式 BNF 语法与您所写的相似.

In this case, RFC 1738 (Uniform Resource Locators) is the resource you want. It's no more "overly technical" than what you've come up with so far; in fact, section 5 has the formal BNF grammar similar to what you wrote.

您可能还对 RFC 3986(统一资源标识符)感兴趣描述 URI 格式,它比单纯的 URL 更通用.

You might also be interested in RFC 3986 (Uniform Resource Identifiers) which describes the URI format, which is more general than mere URLs.

您提到的某些内容特定于 HTTP,在 RFC 2616(超文本传输协议 1.1).第 3.2 节简要介绍了 URI.

Some of the things you mention are specific to HTTP, described in RFC 2616 (Hypertext Transfer Protocol 1.1). Section 3.2 briefly touches on URIs.

这篇关于完整可能的 URL 语法和语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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