|
@@ -24,13 +24,13 @@ class HttpGetHandler(BaseHTTPRequestHandler):
|
|
self.send_header("Content-type", "text/html")
|
|
self.send_header("Content-type", "text/html")
|
|
self.end_headers()
|
|
self.end_headers()
|
|
res = requests.get('https://api.ipify.org/')
|
|
res = requests.get('https://api.ipify.org/')
|
|
- http_text = """<!doctype html><html><head><meta charset="utf-8">
|
|
|
|
- <title>http-server/info</title></head>
|
|
|
|
- <body>Ваш адресс {get.text}.<br>
|
|
|
|
- <body>Кондратюк Андрей Андреевич<br>
|
|
|
|
- Время на сервере {str(datetime.datetime.now())}
|
|
|
|
- <p>гр 701(3)</p>
|
|
|
|
- </body></html>"""
|
|
|
|
|
|
+ http_text = f"<!doctype html><html><head><meta charset=utf-8>" \
|
|
|
|
+ f"<title>http-server/info</title></head>" \
|
|
|
|
+ f"<body>Ваш адресс {res.text}.<br>" \
|
|
|
|
+ f"<body>Кондратюк Андрей Андреевич<br>" \
|
|
|
|
+ f"Время на сервере {str(datetime.datetime.now())}" \
|
|
|
|
+ f"<p>гр 701(3)</p>" \
|
|
|
|
+ f"</body></html>"
|
|
|
|
|
|
self.wfile.write(http_text.encode(encoding='utf-8'))
|
|
self.wfile.write(http_text.encode(encoding='utf-8'))
|
|
|
|
|