Merge
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import socket
|
||||
|
||||
s = socket.socket() # instantiate
|
||||
hostname = "my.ohm-hochschule.de"
|
||||
path = "content/index.jspx"
|
||||
host = socket.gethostbyname(hostname) # as both code is running on same pc
|
||||
port = 80
|
||||
CRLF = "\r\n"
|
||||
|
||||
s.connect((host,port))
|
||||
msg = ( "GET /{} HTTP /1.1{}".format(path, CRLF) + "Host: {}{}".format(hostname, CRLF) + CRLF)
|
||||
print(msg)
|
||||
s.send(msg.encode())
|
||||
bytes = s.recv(4096)
|
||||
print(bytes.decode())
|
||||
s.close()
|
||||
Reference in New Issue
Block a user