Web Technology Basics
A browser opens https://www.example.com:8443/docs/guide.html?lang=ja#install. Which part of this URL is not included in the request sent to the server and is used only inside the browser after the page loads?
- A:8443
- B?lang=ja
- C#install
Show answer and explanation
Answer: C. #install
This URL consists of the scheme (https), the host name (www.example.com), the port number (8443; if omitted, 443 for https), the path (/docs/guide.html), the query (lang=ja) and the fragment (install). The browser uses the port number to decide where to connect and sends the path and query to the server in the request, but it does not send the fragment after #. The fragment is used only inside the browser, for example to move to the position of the element with id="install" in the page.
- A. The port number is used to decide where to connect, and a non-default port number is also included in the Host header.
- B. The query is sent to the server in the request together with the path and is used, for example, as conditions for the server's processing.
- C. Correct. The fragment is not sent to the server; the browser uses it to indicate a position in the page and the like.