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:
14
h/HTTP.py
Normal file
14
h/HTTP.py
Normal 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()
|
||||
Reference in New Issue
Block a user