- Building Microservices with Go
- Nic Jackson
- 369字
- 2021-07-15 17:28:06
URIs
One of the main components in the HTTP protocol is a URI. URI stands for Uniform Resource Identifiers and is the method by which you will access the API. You may be asking what the difference between a URI and a URL (Uniform Resource Locator) is? When I started to write this chapter, I wondered about this myself and did what any self-respecting developer would do, which is to head over to Stack Overflow. Unfortunately, my confusion only grew as there were lots of detailed answers, none of which I found particularly enlightening. Time to head over to the inner circle of hell also known as W3C standards to look up the RFC for the official answer.
In short, there is no difference, a URL is a URI that identifies a resource by its network location, and it is acceptable to interchange the terms when describing a resource entirely.
The clarification document published back in 2001 (http://www.w3.org/TR/uri-clarification) goes on to explain that in the early to mid-90s there was an assumption that an identifier is cast into one or two classes. An identifier might specify the location of a resource (URL) or its name (Uniform Resource Name URN) independent of location. A URI could either be a URL or a URN. Using this example, http:// would be a URL scheme and isbn: a URN scheme. However, this changed over time and the importance of the additional level of hierarchy lessened. The view changed that an individual scheme does not need to be cast into one of a discrete set of types.
The conventional approach is that http: is a URI scheme and urn: is also a URI scheme. URNs take the form urn:isbn:n-nn-nnnnnn-n, isbn: is a URN namespace identifier, not a URN scheme or a URI scheme.
Following this view, the term URL does not refer to a formal partition of URI space rather, URL is an informal concept; a URL is a type of URI that identifies a resource via its network location.
For the rest of this book, we will use the term URI and when we do we will be talking about a method to access a resource that is running on a remote server.
- Mastering Selenium WebDriver
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲(chóng)案例實(shí)戰(zhàn)全流程詳解(入門(mén)與提高篇)
- RISC-V體系結(jié)構(gòu)編程與實(shí)踐(第2版)
- SQL Server從入門(mén)到精通(第3版)
- Unity UI Cookbook
- 用戶(hù)體驗(yàn)可視化指南
- Visual Foxpro 9.0數(shù)據(jù)庫(kù)程序設(shè)計(jì)教程
- Statistical Application Development with R and Python(Second Edition)
- Visual FoxPro 6.0程序設(shè)計(jì)
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)及考試指南
- 從零開(kāi)始學(xué)UI設(shè)計(jì)·基礎(chǔ)篇
- Learning iOS Penetration Testing
- TypeScript High Performance
- Python程序設(shè)計(jì)教程
- Cadence Concept-HDL & Allegro原理圖與電路板設(shè)計(jì)(第2版)