URLs Flashcards
Understand how links work
What does URL stand for and what is its purpose in the context of the World Wide Web?
URL stands for Universal Resource Locator, and its purpose is to provide a way to reference and access specific resources on the internet through hypertext links.
How did the World Wide Web adapt the idea of hypertext, and what technology did it introduce to standardize it?
The World Wide Web adapted the idea of hypertext by incorporating it into its fundamental structure, allowing for interconnected web pages. It introduced Uniform Resource Locators (URLs) to standardize the naming and linking of web content.
What does the ‘scheme’ in a URL specify, and give an example?
The ‘scheme’ in a URL specifies the protocol used to fetch the content. For example, ‘http’ in ‘http://host.company.com’.
Explain the significance of the server’s port number in a URL.
The server’s port number in a URL, like ‘80’ in ‘http://host.company.com:80’, allows multiple servers to run on the same machine by distinguishing them through different port numbers.
How does the hierarchical portion of a URL function, and provide an example from the given URL.
The hierarchical portion of a URL, such as ‘/a/b/c.html’, is used by the server to locate the specific content requested. In the provided URL ‘http://host.company.com:80/a/b/c.html’, it directs to the file ‘c.html’ located in the directory ‘/a/b’.
What role do query parameters play in a URL, and give an example?
Query parameters in a URL provide additional data to the server, often for dynamic page generation or tracking purposes. An example is ‘?user=Alice&year=2008’, which sends the parameters ‘user’ and ‘year’ to the server.
What is the primary function of a URL scheme and give an example of two commonly used schemes.
The primary function of a URL scheme is to define the protocol or method to be used for accessing a specified resource. Common examples include http:
for accessing web resources using HTTP, and https:
which is similar but includes SSL encryption for security.
What does the file:
URL scheme indicate, and how is it used?
The file:
URL scheme indicates that the resource is a file located on the local disk. It is used to access or read files directly from the user’s computer.
Explain the purpose of the websocket:
URL scheme.
The websocket:
URL scheme is used to create a TCP (Transmission Control Protocol) connection, typically for real-time data exchange in web applications, such as live messaging or streaming services.
What action does the mailto:
URL scheme trigger, and give a practical example of its use.
The mailto:
URL scheme triggers an email program to open, composing a message to the specified email address. A practical example is mailto:example@email.com
, which would open the user’s default email client with a new message addressed to example@email.com.
What is the hierarchical portion of a URL, and what was its original purpose in early web servers?
The hierarchical portion of a URL is the part following the domain name and a slash, used to direct the web server to the requested content. In early web servers, it was typically a path name to a static HTML file.
How does modern web server routing use the hierarchical portion of a URL?
Modern web servers use routing information to interpret the hierarchical portion of a URL, mapping specific paths to functions and possibly their parameters. This is essential in API design, allowing URLs to represent different operations like creating, listing, or deleting resources.
Give examples of how the hierarchical portion of a URL is used in API design.
In API design, the hierarchical portion of a URL represents different operations. For example, /user/create might be used to create a user, /user/list to list users, /user/0x23490 to retrieve a specific user, and /user/delete/0x23433 to delete a user.
What are query parameters in a URL, and how are they structured?
Query parameters in a URL are additional parameters provided to a web operation, appended to the end of the URL with a question mark (?). They consist of key-value pairs, separated by an equals sign (=), and multiple parameters are separated by an ampersand (&).
Explain the role of query parameters in modern web applications.
In modern web applications, query parameters are used not only to provide additional data to web operations but also to control when the browser switches pages or dynamically updates content, especially in single-page applications where content changes without a full page reload.