URLs

Importance of URLs

  • URLs allows Clients to specify (to the Server) which resources it wants to work it (create, read, update or delete)

  • URL stands for “Uniform Resource Locator”

  • Parts of a url are mandatory (such as the “http”) and parts are optional (i.e. ?key=1&key=2)

    • All parts the parts of a URL are meant to provide context to the Server so the Server will know how to handle the HTTP Request

Anatomy of a URL

  • Let’s look at the following URL:

    https://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereInTheDocument
    

    It is made up of the following parts:

    Part Example Description
    Protocol https communicate to the Server that the HTTP protocol is being used for this Request (FTP, mailto) are examples of other protocols
    Domain www.example.com Name of the web server being requested
    Path /path/to/myfile.html The path to the resource on the Server
    Query ?/key1=value&key2=value Extra parameters provided to the Server
    Anchor #SomewhereInTheDocument An anchor to another part of the document; works a “bookmark” inside the resource