This and the other “Deck” posts are a repurposing of flashcard study decks to Q&A blog posts. Google was not showing love to this content as a set of flashcards and I didn’t want to delete them entirely, I hope you find it useful.
What is a URL Path?
A URL path is the location of a resource within a domain, ex. domain.com/parent_resource/sub_resource.
When should you use a URL Path vs Query Parameter?
Query parameters are most often used to filter for resources within a collection while URL Paths are used to locate a resource type. For example cars.co/toyota/camry is using a url path to find all cars of type Camry but cars.co/toyota/camery?color=red is using the URL path and a query param to filter the collection of Camry’s to only give back results that include a color red.
When would you use URL Path vs Subdomain?
You will want to use a URL path instead of a subdomain when the resource is specific to the business function of your main application. Subdomains are used to identify different functions from the core application or for different organizations accessing your application.