Add HTTP (python built-in module) (#1248)

* Create HTTP.py

* add http.py to list

* edit text, typo :|

Co-authored-by: MrBrain295 <66077254+MrBrain295@users.noreply.github.com>

Co-authored-by: MrBrain295 <66077254+MrBrain295@users.noreply.github.com>
This commit is contained in:
The Peeps191
2022-01-20 17:35:32 -07:00
committed by GitHub
parent 3c5bd89516
commit 314d1eb061
2 changed files with 16 additions and 2 deletions

14
h/HTTP.py Normal file
View File

@@ -0,0 +1,14 @@
import http.server
import socketserver
from http import HTTPStatus
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(HTTPStatus.OK)
self.end_headers()
self.wfile.write(b'Hello World')
httpd = socketserver.TCPServer(('', 8000), Handler)
httpd.serve_forever()