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 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://[email protected]. 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:[email protected] may start an e-mail composer with the address [email protected] 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.

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。