модифицированный http_tcp.py(3 задание)
This commit is contained in:
parent
6ffba90da2
commit
85f0f643d7
@ -2,7 +2,13 @@ import socket
|
|||||||
|
|
||||||
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
client.connect(('vyatsu.ru', 80))
|
client.connect(('vyatsu.ru', 80))
|
||||||
request = "GET / HTTP/1.1\r\nHost: vyatsu.ru\r\n\r\n"
|
request = (
|
||||||
|
"GET / HTTP/1.1\r\n"
|
||||||
|
"Host: vyatsu.ru\r\n"
|
||||||
|
"User-Agent: python-requests/2.33.1\r\n"
|
||||||
|
"Accept: */*\r\n"
|
||||||
|
"\r\n"
|
||||||
|
)
|
||||||
client.sendall(request.encode())
|
client.sendall(request.encode())
|
||||||
response = client.recv(4096)
|
response = client.recv(4096)
|
||||||
print(response.decode())
|
print(response.decode())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user