1.

What is URI?

Answer»

Uniform Resource Identifier is the full form of URI which is used for identifying each resource of the REST architecture. URI is of the format:

<PROTOCOL>://<service-name>/<ResourceType>/<ResourceID>

There are 2 TYPES of URI:

  • URN: Uniform Resource Name identifies the resource by means of a name that is both unique and persistent.
    • URN doesn’t always specify where to locate the resource on the internet. They are used as templates that are used by other parsers to identify the resource.
    • These FOLLOW the urn SCHEME and usually prefixed with urn:. Examples include
      • urn:isbn:1234567890 is used for identification of book based on the ISBN number in a library application.
      • urn:mpeg:mpeg7:schema:2001 is the default namespace rules for metadata of MPEG-7 video.
    • Whenever a URN identifies a document, they are easily translated into a URL by using “resolver” after which the document can be downloaded.
  • URL: Uniform Resource LOCATOR has the information regarding fetching of a resource from its location.
    • Examples include:
      • http://abc.com/samplePage.html
      • ftp://sampleServer.com/sampleFile.zip
      • file:///home/interviewbit/sampleFile.txt
    • URLs start with a protocol (like ftp, http etc) and they have the information of the network hostname (sampleServer.com) and the path to the document(/samplePage.html). It can also have query parameters.


Discussion

No Comment Found