From a URL to a response

Read a URL

Break a URL into its scheme, host, port, path, query string, and fragment so you know what each part controls.

7 minute lesson

~~~

Consider this URL:

https://example.com:443/articles/http?format=short#headers

It contains several parts:

  • https is the scheme.
  • example.com is the host.
  • 443 is the port.
  • /articles/http is the path.
  • format=short is the query string.
  • headers is the fragment.

The browser uses the scheme, host, and port to connect. It sends the path and query string to the server as the request target.

The fragment is different. It identifies a place inside the returned document and is normally handled by the browser. It is not sent in the HTTP request.

Default ports are usually omitted: 80 for HTTP and 443 for HTTPS.

Lesson completed