We used the HTTPConnection() method of httplib, which can make a HEAD request to a server. We can specify the path if necessary. Here, the HTTPConnection() method checks the home page or path of http://www.python.org. However, if the URL is not correct, it can't find the return response inside the accepted list of return codes.