Lesson 1

URL Components

Break URLs into scheme, host, port, path, query, and fragment.

A URL is a structured address, not just a string. Debugging becomes easier when you separate its components before interpreting it.

https://api.example.com:8443/v1/items?q=blue&page=2#results

This URL contains:

  • Scheme: https
  • Host: api.example.com
  • Port: 8443
  • Path: /v1/items
  • Query: q=blue&page=2
  • Fragment: results

Scheme

The scheme tells clients how to interpret the rest of the URL. https, http, mailto, and file all imply different rules.

Host and port

The host identifies the server. The port selects the network port. Default ports such as 443 for HTTPS are often omitted in display, but explicit ports matter in local development and service debugging.

Path

The path identifies a resource within the host. It is hierarchical, so /users/42 and /users/42/ may be different depending on the server.

Query

The query begins after ? and often carries filters, pagination, sort order, tracking fields, and OAuth state. Query parsing is not always one-size-fits-all because repeated keys and empty values can be interpreted differently.

Fragment

The fragment begins after #. Browsers use it client-side and do not normally send it to the server in HTTP requests. That matters when debugging why a server cannot see part of a link.

Treat each component as a boundary. Most URL bugs come from encoding or rebuilding across the wrong boundary.

When you want to practice, use the related DevCove tool — optional, not part of this lesson.

Open related tool

Back to course overview