7 lines
227 B
Python
7 lines
227 B
Python
|
from http.client import HTTPConnection
|
||
|
conn = HTTPConnection("example.com")
|
||
|
conn.request("GET", "/")
|
||
|
result = conn.getresponse()
|
||
|
# retrieves the entire contents.
|
||
|
contents = result.read()
|
||
|
print(contents)
|