Vai al contenuto

Web Science/Part1: Foundations of the web/Hypertext Transfer Protocol/A simple web client/quiz

Da Wikiversità, l'apprendimento libero.

1 Which of the following is a correct way of creating a JAVA socket when making an HTTP GET request to http://studywebscience.org/test/simple.html?

new Socket("studywebscience.org",80);
new Socket("studywebscience.org");
new Socket("studywebscience.org/test/simple.html",80);
new Socket("http://studywebscience.org/test/simple.html",80);
new Socket("http://studywebscience.org/test/simple.html");

2 In the video I say You could get an UnknownHostException because someone might not know our server studywebscience.org. What do I actually mean with this statement?

The domain studywebscience.org could not be registered in the domain name system.
The host name studywebscience.org could not be entered in my local host file.
No route to the IP address of the resolved host can be found
the computer might not be connected to the internet:

3 When will an IOException be thrown in the program?

If the host with the resolved IP Address is not online
If network congestions takes place and packages are dropped
If the internet is censored and the packages to the host are blocked
If the DNS cannot resolve the hostname
Always if the computer is not connected to the internet
if the requested file does not exist on the Web server