GithubHelp home page GithubHelp logo

allabouturi's Introduction

URI definition :

  • URI is a string of characters that identifies a resource.
  • also URI is a refrence that points to the actuall data/resource.

formal format of URI:

Scheme:[//[user:password@]host[:port]] [/]path[?query][#fragment]

(anything between square the brackets is optional).

Breakdown of URI:

-so URI can be broken down into 5 parts given below.

  • Scheme = scheme describe what type of resource we are pointing to (eg mailto ,geo,https).
  • authority= authority is the part where we describe user name,password and host.
  • path= path is further navigation to resource eg (/courses/ud851/lessons..)
  • query= query is used to filter the resource.
  • fragment= fragment contains data used by path of query.

Rules for building legitmate URI:

Identify which part of URI is optional

  • Scheme = Not Optional
  • authority = Optional
  • path = Not Optional
  • query = Optional
  • fragment = Optional
  • if authority is present than path should be preceded by "/" ,otherwise its optional.

inside Authority

  • Authority has 3 parts
  • UserName and password = Optional
  • host = Not optional
  • port= Optional
  • "//" in start = Not Optional
inside "UserName and Password"
  • userName =Not optional
  • password=Not optional
  • "UserName and Password" ends with "@" character.
inside "Port"
  • port = Not Optional
  • ":" in start = Not Optional

inside query

  • query = Not Optional
  • "?" in start = Not Optional

inside fragment

  • fragment = Not Optional
  • "#" in start = Not Optional

Some example types

  • Content URI , has scheme content ,A content URI is a URI that identifies data in a provider .
  • formal format

content://authority/path/id

  • content://user_dictionary/words

  • geo URI

  • formal formate

    geo:latitude,longitude?z=level

  • geo:0,0?q=Antwarp,Belgium & Z=10

  • geo URI has scheme geo:

  • in above URI example geo is scheme ,geo scheme describes that the resource/data type to which this URI points is a physical location.

  • in above example scheme geo: is followed by path 0,0 . 0,0 is latitude and longitude .its 0,0 because according to rules if

  • we decribe a string address than lat and long should be 0,0.

  • their is not authority in above example because we don't need it also authority is optional.

    Are geo URI and Content URI legitmate URI's ?

  • lets find out

  • general URI format

    Scheme:[//[user:password@]host[:port]] [/]path[?query][#fragment]

  • content URI format

    content://authority/path/id

  • content URI exampe

    content://user_dictionary/words

  • geo URI format

    geo:latitude,longitude?z=level

  • geo URI example

    geo:0,0?q=Antwarp,Belgium & Z=10

  • so content URI has scheme ,content authority , path so its legitmate as we know scheme and path are must and it has both.

  • and geo URI is also legitmate as it has scheme geo, path, query and as we know scheme and path are must and it has both.

Conclusion

For content provider we only need to worry about Content URI ,as it is used to get data from content provider.

allabouturi's People

Contributors

theandroidboy avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.