url中的scheme
iPhone上URL Schemes的作用为应用程序提供了一个其他应用程序或者safari可以启动他的方法.
--http://blog.sina.com.cn/s/blog_5673c12f0100qd6i.html
iPhone / iOS SDK 最酷的特性之一就是应用将其自身”绑定”到一个自定义 URL scheme 上,该 scheme 用于从浏览器或其他应用中启动本应用。
--http://objcio.com/blog/2014/05/21/the-complete-tutorial-on-ios-slash-iphone-custom-url-schemes/
URL
http://en.wikipedia.org/wiki/Uniform_resource_locator
Syntax
Every HTTP URL consists of the following, in the given order. Several schemes other than HTTP also share this general format, with some variation.
- the scheme name (commonly called protocol, although not every URL scheme is a protocol, e.g. mailto is not a protocol)
- a colon, two slashes,[9][8]
- a host, normally given as a domain name[10] For example, http://www.example.com/path/to/name would have been written http:com/example/www/path/to/name[7] but sometimes as a literal IP address
- optionally a colon followed by a port number
- the full path of the resource
The scheme says how to connect, the host specifies where to connect, and the remainder specifies what to ask for.
For programs such as Common Gateway Interface (CGI) scripts, this is followed by a query string,[11][12] and an optional fragment identifier.[13]
The syntax is:
- scheme://[user:password@]domain:port/path?query_string#fragment_id
Component details:
- The scheme, which in many cases is the name of a protocol (but not always), defines how the resource will be obtained. Examples include http, https, ftp, file and many others. Although schemes are case-insensitive, the canonical form is lowercase.
- The domain name or literal numeric IP address gives the destination location for the URL. A literal numeric IPv6 address may be given, but must be enclosed in [ ] e.g.[db8:0cec::99:123a].
- The domain google.com, or its numeric IP address 173.194.34.5, is the address of Google's website.
- The domain name portion of a URL is not case sensitive since DNS ignores case:
- http://en.example.org/ and HTTP://EN.EXAMPLE.ORG/ both open the same page.
- The port number, given in decimal, is optional; if omitted, the default for the scheme is used.
- For example, http://vnc.example.com:5800 connects to port 5800 of vnc.example.com, which may be appropriate for a VNC remote control session. If the port number is omitted for an http: URL, the browser will connect on port 80, the default HTTP port. The default port for an https: request is 443.
- The path is used to specify and perhaps find the resource requested. This path may or may not describe folders on the file system in the web server. It may be very different from the arrangement of folders on the web server. It is case-sensitive,[14] though it may be treated as case-insensitive by some servers, especially those based on Microsoft Windows.
- If the server is case sensitive and http://en.example.org/wiki/URL is correct, then http://en.example.org/WIKI/URL or http://en.example.org/wiki/url will display an HTTP 404 error page, unless these URLs point to valid resources themselves.
- The query string contains data to be passed to software running on the server. It may contain name/value pairs separated by ampersands, for example
- ?first_name=John&last_name=Doe.
- The fragment identifier, if present, specifies a part or a position within the overall resource or document.
- When used with HTML, it usually specifies a section or location within the page, and used in combination with Anchor elements or the "id" attribute of an element, the browser is scrolled to display that part of the page.
The scheme name defines the namespace, purpose, and the syntax of the remaining part of the URL. Software will try to process a URL according to its scheme and context. For example, a web browser will usually dereference the URL http://example.org:80 by performing an HTTP request to the host at example.org, using port number 80.
Other examples of scheme names include https, gopher, wais, ftp. URLs with https as a scheme (such as https://example.com/) require that requests and responses will be made over a secure connection to the website. Some schemes that require authentication allow a username, and perhaps a password too, to be embedded in the URL, for exampleftp://asmith@ftp.example.org. Passwords embedded in this way are not conducive to security, but the full possible syntax is
- scheme://username:password@domain:port/path?query_string#fragment_id
Other schemes do not follow the HTTP pattern. For example, the mailto scheme only uses valid email addresses. When clicked on in an application, the URLmailto:bob@example.com may start an e-mail composer with the address bob@example.com in the To field. The tel scheme is even more different; it uses the public switched telephone network for addressing, instead of domain names representing Internet hosts.
棒棒哒~
http://segmentfault.com/q/1010000003056554
在URL里面,当然是search
在前,hash
在后。
'?search=a' 整个地是location.search
,'#hash'整个地才是location.hash
关于URI的格式是由RFC 3986规定的。
其中?search=a
这种叫query
,#hash
叫fragment
。
* query
的规定是以第一个?
开始,至行尾或#
结束。
* fragment
以#
为开始,行尾为结束。
也就是说query
必须在fragment
之前。
另外根据query
和fragment
字符限定的规定,两者中都可以含有/
和?
,但不可以含有#
。(还有其它的限制,这里是简要的说法,因为我们此处要讨论以?
和#
开头的字串)所以Angular.js中出现的http://example.com/#/some/path?search=a#hash
实际上是不符合RFC规定的。但是此处是为了给不支持HTML5的浏览器提供兼容支持,也是无奈之举。
对URL在#之后的部分做变动不会刷新页面,你可以在浏览器的console里分别输入window.location.hash="#hash"
和window.location.search="?sa"
执行看看结果,后者是会刷新页面的。HTML5有History API可以不刷新页面对URL进行修改,就不用加一个#
号来防刷新了。另外有#
分割做单页应用的时候服务器那边也好处理……
hash
的部分是不会传到服务器的(没刷新),即正常请求的话,#
后面的部分服务器是接收不到的
当然js
检测hash
然后发起不同的请求另说.
这个不存在什么规范的问题吧,看自身怎么架构的吧
uri是url的超集
http://www.cnblogs.com/hust-ghtao/p/4724885.html
“A URI 可以进一步被分为定位符、名字或两者都是. 术语“Uniform Resource Locator” (URL) 是URI的子集, 除了确定一个资源,还提供一种定位该资源的主要访问机制(如其网络“位置”)。“
- 让URI能成为URL的当然就是那个“访问机制”,“网络位置”。e.g.
http://
orftp://
.。
总结
下面到了回答问题的时候了:
当我们替代web地址的时候,URI和URL那个更准确?
基于我读的很多的文章,包括RFC,我想说URI更准确。
别急,我有我的理由:
我们经常使用的URI不是严格技术意义上的URL。例如:你需要的文件在files.hp.com
. 这是URI,但不是URL--系统可能会对很多协议和端口都做出正
确的反应。
你去http://files.hp.com
和ftp://files.hp.com
.可能得到完全不同的内容。这种情况可能更加普遍,想想不同谷歌域名上的不同服务啊。
所以,用URI吧,这样你通常技术上是正确的,URL可不一定。最后“URL”这个术语正在被弃用。所以明智吧少年!
url中的scheme的更多相关文章
- 飘逸的python - 用urlparse从url中抽离出想要的信息
最近有个需求,要检测配置中的那些url的域名是否都正常,即是否都能ping通. 不过配置中url格式是这样的 http://www.something.com:1234/ . 要ping的是www.s ...
- 对 url 中含有的中文进行转码操作
对 url 中含有的中文进行转码操作 一般情况下,将带有中文的 url 拷贝到开发工具,开发工具都会有相应的转码(自动转码), 现在大部分的浏览器也可以对含有中文的 url 进行转码(自动转码) 情景 ...
- input屏蔽历史记录 ;function($,undefined) 前面的分号是什么用处 JSON 和 JSONP 两兄弟 document.body.scrollTop与document.documentElement.scrollTop兼容 URL中的# 网站性能优化 前端必知的ajax 简单理解同步与异步 那些年,我们被耍过的bug——has
input屏蔽历史记录 设置input的扩展属性autocomplete 为off即可 ;function($,undefined) 前面的分号是什么用处 ;(function($){$.ex ...
- 大侠稍等!URL 中为何出现奇怪的字符
为什么中文名称的图片打开后网址是一串乱码?为什么好好的短网址复制粘贴就变长了一大长串?罪魁祸首居然是-- 杭州终于出梅了!二狗子看到气象台发布的消息,开心的不得了.杭州的雨从五月底一直下,每天除了雨还 ...
- 如何获取url中的参数并传递给iframe中的报表
在使用报表软件时,用户系统左边一般有目录树,点击报表节点就会在右侧网页的iframe中显示出报表,同时点击的时候也会传递一些参数给网页,比如时间和用户信息等.如何使网页中的报表能够获取到传递过来的参数 ...
- 记录一次bug解决过程:velocity中获取url中的参数
一.总结 在Webx的Velocity中获取url中参数:$rundata.getRequest().getParameter('userId') 在Webx项目中,防止CSRF攻击(Cross-si ...
- JavaScript如何获取网页url中的参数
我们可以自定义一个公共函数来实现网页url中的参数获取,返回的是一个数组 GetUrlRequest: function () { var url = decodeURI(location.searc ...
- js获取页面url中的各项值
一. 通过window.location获取各项参数 1.获取页面完整的url url = window.location.href; 2.获取页面的域名 host = window.location ...
- url中的特殊符号含义
1. # 10年9月,twitter改版.一个显著变化,就是URL加入了"#!"符号.比如,改版前的用户主页网址为http://twitter.com/username改版后,就变 ...
随机推荐
- gridview自定义表头
gridview为我们提供了丰富的接口,用于满足自定义需求. 通常asp:gridview会根据绑定的列Columns自动生成表头,展现在前台元素. 序号 类别 有时候需要复杂一些的表头. 序号 类别 ...
- JavaScript对象 + Browser 对象 + HTML DOM 对象
JavaScript 对象 Array Boolean Date Math Number String RegExp Global Browser 对象 Window Navigator Screen ...
- 【解题报告】POJ-1467 Symbolic Derivation
原题地址:http://poj.org/problem?id=1467 题目大意: 对一个式子求导,给的式子包括常量,字母x,+,-,*,/,ln()运算符,任意嵌套的括号.求的导数式子不用化简,如1 ...
- 微信 ua
Mozilla/5.0 (Linux; U; Android 2.3.6; zh-cn; GT-S5660 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, l ...
- Readonly与const初识
对于readonly和const,很多人无法具体区分,不清楚它们的具体使用场合:现在我们分析它们之间的区别和使用场合. const是一个编译期常量:const只能用于修饰基元类型.枚举类型或者字符串类 ...
- C# ComboBox自动完成功能的示例
先看一下关键代码: DataTable dt = new DataTable(); dt.Columns.Add("Name"); dt.Columns.Add("VV& ...
- nginx中针对目录进行IP限制
一个不错的nginx中针对目录进行IP限制 ,这里我以phpmyadmin目录只能让内网IP访问,而外网不能访问的配置方法,有需要的同学可参考. nginx phpmyadmin 针对内网ip用户开放 ...
- Java读取excel指定sheet中的各行数据,存入二维数组,包括首行,并打印
1. 读取 //读取excel指定sheet中的各行数据,存入二维数组,包括首行 public static String[][] getSheetData(XSSFSheet sheet) thro ...
- Linux下安装Vapor
1.官网下载Vapor软件(二进制安装文件) 注:注意版本,linux下可以在终端输入-uname -l 查看系统版本 2.cd到Vapor软件所在目录 3.解压:1)gunzip vapor-*** ...
- java中的Switch case语句
java中的Switch case 语句 在Switch语句中有4个关键字:switch,case break,default. 在switch(变量),变量只能是整型或者字符型,程序先读出这个变量的 ...