Created
April 24, 2022 03:00
-
-
Save ssrlive/e3957ae430b0ef1ab9bae57d3d130b53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import sys | |
import http.client | |
def main(argv): | |
if len(argv) != 2 : | |
print("\nUsage: ", argv[0], " <hostname>") | |
print("\n- <hostname> looks like www.python.org\n") | |
sys.exit(1) | |
conn = http.client.HTTPSConnection(argv[1]) | |
conn.request("GET", "/") | |
r1 = conn.getresponse() | |
print(r1.status, r1.reason) | |
data1 = r1.read() | |
#print(data1) | |
conn.close() | |
if __name__ == "__main__" : | |
main(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment