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 httphttpsftpfile 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 httpsgopherwaisftp. 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#hashfragment
query的规定是以第一个?开始,至行尾或#结束。
fragment#为开始,行尾为结束。
也就是说query必须在fragment之前。

另外根据queryfragment字符限定的规定,两者中都可以含有/?,但不可以含有#。(还有其它的限制,这里是简要的说法,因为我们此处要讨论以?#开头的字串)所以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:// or ftp://.。
总结

下面到了回答问题的时候了:

当我们替代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的更多相关文章

  1. 飘逸的python - 用urlparse从url中抽离出想要的信息

    最近有个需求,要检测配置中的那些url的域名是否都正常,即是否都能ping通. 不过配置中url格式是这样的 http://www.something.com:1234/ . 要ping的是www.s ...

  2. 对 url 中含有的中文进行转码操作

    对 url 中含有的中文进行转码操作 一般情况下,将带有中文的 url 拷贝到开发工具,开发工具都会有相应的转码(自动转码), 现在大部分的浏览器也可以对含有中文的 url 进行转码(自动转码) 情景 ...

  3. input屏蔽历史记录 ;function($,undefined) 前面的分号是什么用处 JSON 和 JSONP 两兄弟 document.body.scrollTop与document.documentElement.scrollTop兼容 URL中的# 网站性能优化 前端必知的ajax 简单理解同步与异步 那些年,我们被耍过的bug——has

    input屏蔽历史记录   设置input的扩展属性autocomplete 为off即可 ;function($,undefined) 前面的分号是什么用处   ;(function($){$.ex ...

  4. 大侠稍等!URL 中为何出现奇怪的字符

    为什么中文名称的图片打开后网址是一串乱码?为什么好好的短网址复制粘贴就变长了一大长串?罪魁祸首居然是-- 杭州终于出梅了!二狗子看到气象台发布的消息,开心的不得了.杭州的雨从五月底一直下,每天除了雨还 ...

  5. 如何获取url中的参数并传递给iframe中的报表

    在使用报表软件时,用户系统左边一般有目录树,点击报表节点就会在右侧网页的iframe中显示出报表,同时点击的时候也会传递一些参数给网页,比如时间和用户信息等.如何使网页中的报表能够获取到传递过来的参数 ...

  6. 记录一次bug解决过程:velocity中获取url中的参数

    一.总结 在Webx的Velocity中获取url中参数:$rundata.getRequest().getParameter('userId') 在Webx项目中,防止CSRF攻击(Cross-si ...

  7. JavaScript如何获取网页url中的参数

    我们可以自定义一个公共函数来实现网页url中的参数获取,返回的是一个数组 GetUrlRequest: function () { var url = decodeURI(location.searc ...

  8. js获取页面url中的各项值

    一. 通过window.location获取各项参数 1.获取页面完整的url url = window.location.href; 2.获取页面的域名 host = window.location ...

  9. url中的特殊符号含义

    1. # 10年9月,twitter改版.一个显著变化,就是URL加入了"#!"符号.比如,改版前的用户主页网址为http://twitter.com/username改版后,就变 ...

随机推荐

  1. 【转】Eclipse+PyDev 安装和配置

    原文网址:http://www.51testing.com/html/67/589567-866611.html Python开发有很多工具,其中Eclipse+Pydev 是最常见的一种.本文简单介 ...

  2. Spring aop 实现异常拦截

    使用aop异常挂载功能可以统一处理方法抛出的异常,减少很多重复代码,实现如下: 1.实现ThrowAdvice public class ExceptionHandler implements Thr ...

  3. PHP Framework安装

    Framework 1> 初始化 前提:服务器上已经装有 Apache/Nginx 和 MySQL 进入 hush-framework/hush-app/bin 目录(Linux 下需执行 ch ...

  4. [转] Asp.Net 导出 Excel 数据的9种方案

    湛刚 de BLOG 原文地址 Asp.Net 导出 Excel 数据的9种方案 简介 Excel 的强大之处在于它不仅仅只能打开Excel格式的文档,它还能打开CSV格式.Tab格式.website ...

  5. AE 中的查找与定位,以城市查找为例

    在文本框输入一个城市,在地图上查找,当找到后让mapcontrol自动跳转到地图上该点. IQueryFilter filter = new QueryFilterClass(); filter.Wh ...

  6. Android学习随笔--ListView的分页功能

    第一次写博客,可能格式,排版什么的会非常不美观,不过我主要是为了记录自己的Android学习之路,为了以后能有些东西回顾.既然是为了学习,那我肯定会吸收各位大大们的知道经验,有不足的地方请指出. 通过 ...

  7. robotframework学习

    下载地址: https://pypi.python.org/pypi/robotframework Installation If you already have Python with pip i ...

  8. 从SVN导出指定版本号之间修改的文件(转)

    从SVN导出指定版本号之间修改的文件(转)   当一个网站项目进入运营维护阶段以后,不会再频繁地更新全部源文件到服务器,这个时间的修改大多是局部的,因此更新文件只需更新修改过的文件,其他没有修改过的文 ...

  9. cJSON学习笔记

    1.JSON格式简述 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式.易于人阅读和编写,同时也易于机器解析和生成.它基于JavaScript(Standa ...

  10. XAML概览 1(译自JeremyBytes.com)

    (文章译自JeremyBytes.com,由于原文太长,故分成几篇,能力所限,如有疏漏,希望海涵.另外若有侵权,务必尽快告知) Overview 了解XAML (可扩展应用程序标记语言)是使用WPF和 ...