0.5.10 Reading a URL

A URL Identifies a Web Resource

A URL, or Uniform Resource Locator, gives a client information used to identify and access a resource.

Consider:

Plain text
https://example.com/teams/wildcats

This URL can be separated into parts.

At an introductory level, focus on:

Later, query parameters can add more information to the request.

The Scheme Comes First

In:

Plain text
https://example.com/teams/wildcats

the scheme is:

Plain text
https

It appears before:

Plain text
://

The scheme tells the client which kind of communication convention applies.

For Web use, you commonly encounter:

Plain text
http
https

https is used for HTTP communication protected with transport security.

The Host Identifies the Destination

The host is:

Plain text
example.com

It identifies the destination host name the browser needs to reach.

The browser uses networking services to reach the appropriate system for that host.

You do not need to trace domain-name lookup or routing in detail in this activity.

The important reading skill is recognizing:

Plain text
example.com

as the host portion of the URL.

The Path Identifies a Resource Location

The path is:

Plain text
/teams/wildcats

The path tells the destination server which resource or route is being requested.

A different path can identify a different resource on the same host.

For example:

Plain text
https://example.com/teams/wildcats

and:

Plain text
https://example.com/teams/rangers

use the same scheme and host.

Their paths differ.

Read the URL From Left to Right

For:

Plain text
https://example.com/teams/wildcats

read:

Scheme

Plain text
https

Host

Plain text
example.com

Path

Plain text
/teams/wildcats

That gives the browser increasingly specific information about the requested destination.

The Path Can Have Several Segments

Consider:

Plain text
https://example.com/leagues/north/teams/wildcats

The path is:

Plain text
/leagues/north/teams/wildcats

It contains several slash-separated segments.

Those segments are meaningful according to the website or server design.

Do not assume every website uses the same path structure.

A URL May Have No Visible Path Beyond /

Consider:

Plain text
https://example.com/

The host is still:

Plain text
example.com

The path is the root:

Plain text
/

The server can decide what resource to return for that path.

Query Information Can Appear After ?

You may encounter:

Plain text
https://example.com/search?team=wildcats

The part after:

Plain text
?

is query information.

The next batch focuses on query parameters.

For now, separate:

Base resource

Plain text
https://example.com/search

from:

Query

Plain text
team=wildcats

URLs Can Encode Information

A URL is not merely a human-readable website label.

Its parts provide structured information the browser uses when creating a request.

That is why small changes can matter.

Compare:

Plain text
https://example.com/team

with:

Plain text
https://example.com/teams

A single character changes the path.

The server may treat those as different resources.

URLs Are Case-Sensitive in Some Parts and Systems

Do not assume that changing capitalization always produces the same resource.

Host names are generally treated without letter-case distinction, while the path may be case-sensitive depending on the server and resource.

The safest practice is to preserve the URL exactly as it is supplied or intentionally constructed.

A URL Connects User Input to a Web Request

Earlier, the web flow was:

Plain text
User enters URL
      ↓
Browser creates request
      ↓
Server processes request

Now the URL is less mysterious.

It supplies structured information the browser can use to determine:

The next step is learning how query parameters can add user-supplied information to that request.