上QQ阅读APP看书,第一时间看更新
URI
We have talked a lot about resources. They are actually the pages that we see on a particular website. However, resources in HTTP are not just simple files in the form of HTML web pages. Generally, a resource is defined as any piece of information that can be uniquely identified by a URI, such as http://packtpub.com/.
Let's talk about URIs for a moment. A URI consists of a few components: a URI scheme name, such as http or ftp is the first part, followed by a colon character. After the colon character comes the hierarchical part:
<scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]
Let's analyze one URI:
https://www.flipkart.com/men/tshirts/pr?sid=2oq%2Cs9b%2Cj9y
Let's break down the preceding URI:
- The scheme name is https.
- The scheme name is followed by the hierarchical part, //www.flipkart.com/men/tshirts/pr. The hierarchical part starts with //.
- The hierarchical part also contains an optional query, which is sid=2oq%2Cs9b%2Cj9y, in this case.
The following is an example of a URI containing the optional fragment part:
https://en.wikipedia.org/wiki/Packt#PacktLib