URI格式

简介:
URI貌似属于比较基本的一种协议,虽然我经常记不住它的具体格式。今天在WIKI上看到一个比较详细的格式描述,所以copy下来保留,仅此而已。
出自:http://en.wikipedia.org/wiki/URI_scheme

< scheme  name > :  < hierarchical  part > [ ?  < query > ] [ #  < fragment > ]

The following figure displays two example URIs ( foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose  and urn:example:animal:ferret:nose ) and their component parts. (The examples are derived from RFC 3986 — STD 66, chapter 3).
  foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose
  \_/   \_______________/ \_________/ \__/            \___/ \_/ \______________________/ \__/
   |           |               |       |                |    |            |                |
   |       userinfo           host    port              |    |          query          fragment
   |    \________________________________/\_____________|____|/ \__/        \__/
 scheme                 |                          |    |    |    |          |
  name              authority                      |    |    |    |          |
   |                                             path   |    |    interpretable as keys
   |                                                    |    |
   |    \_______________________________________________|____|/       \____/     \_____/
   |                         |                          |    |          |           |
 scheme              hierarchical part                  |    |    interpretable as values
  name                                                  |    |
   |            path               interpretable as filename |
   |   ___________|____________                              |
  / \ /                        \                             |
  urn:example:animal:ferret:nose               interpretable as extension
                path
         _________|________
 scheme /                  \
  name  userinfo  hostname       query
  _|__   ___|__   ____|____   _____|_____
 /    \ /      \ /         \ /           \
 mailto:username@example.com?subject=Topic

相关文章
|
3月前
|
数据安全/隐私保护
URI 和URL 的区别是什么?
URI 和URL 的区别是什么?
|
4月前
|
PHP
URI和URL的区别
URI和URL的区别
|
编解码 网络协议 程序员
HTTP协议格式、URL格式及URL encode
HTTP协议格式、URL格式及URL encode
HTTP协议格式、URL格式及URL encode
$request_uri和$uri
$request_uri This variable is equal to the *original* request URI as received from the client including the args. It cannot be modified. Look at $uri for the post-rewrite/altered URI. Does not in
1442 0
|
Web App开发 存储 编解码
为什么要进行 URL 编码???
我们都知道Http协议中参数的传输是"key=value"这种简直对形式的,如果要传多个参数就需要用“&”符号对键值对进行分割。 如"?name1=value1&name2=value2",这样在服务端在收到这种字符串的时候,会用“&”分割出每一个参数,然后再用“=”来分割出参数值。 针对“name1=value1&name2=value2”我们来说一下客户端到服务端的概念上解析过程: 上述字符串在计算机中用ASCII吗表示为:
318 0
使用正则表达式解析http请求url中的参数和参数值
使用正则表达式解析http请求url中的参数和参数值
394 0
使用正则表达式解析http请求url中的参数和参数值