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:
httpsis the scheme.example.comis the host.443is the port./articles/httpis the path.format=shortis the query string.headersis 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