We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

URL Paths

The URL Path comes right after the domain (or port if one is provided) in a URL string.

In this URL:

`http://testdomain.com/root/next`

The path is:

/root/next

Path Conventions

Many static websites (websites where the content does not change, as opposed to dynamic web applications) use paths as a direct mapping to the path to the server's file system. For example, If I was running a static web server for "mystaticstate.com" from the root of my file system, a GET request to http://mystaticstate.com/documents/hello.txt would serve the file at /documents/hello.txt from my server.

Click to play video

Most dynamic web applications don't use this simple mapping of URL path -> file path. Technically, a URL path is just a string that the web server can do what it wants with, and modern websites take advantage of that flexibility. Some common examples of what paths are used for include:

  • The hierarchy of pages on a website, whether or not that reflects a server's file structure
  • Parameters passed into an HTTP request, like the ID of a resource
  • The version of the API
  • The type of resource being requested

Assignment

Fix the getResources function. This is a flexible function that, given a path, makes a GET request to the Jello server and returns the response body. Update the fullURL string so that it's the base URL, in our case https://api.boot.dev, concatenated with the given path.