From 314d1eb061ab6b58f3233b0c4c8a39b4b33b2672 Mon Sep 17 00:00:00 2001 From: The Peeps191 <74725787+ThePeeps191@users.noreply.github.com> Date: Thu, 20 Jan 2022 17:35:32 -0700 Subject: [PATCH] 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> --- h/HTTP.py | 14 ++++++++++++++ readme.md | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 h/HTTP.py diff --git a/h/HTTP.py b/h/HTTP.py new file mode 100644 index 00000000..6b2f8518 --- /dev/null +++ b/h/HTTP.py @@ -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() diff --git a/readme.md b/readme.md index 2be1c272..3ceb9a74 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,7 @@ Thanks to everyone who continues to contribute; new languages are created every Make sure to see [contributing.md](/contributing.md) for instructions on contributing to the project! -## Languages (875 total) - +## Languages (871 total) * [!@#$%^&*()_+](%23/%21%40%23%24%25%5E%26%E2%88%97%28%29_%2B) * [():;#?!](%23/%28%29%CB%B8%3B%23%EF%BC%9F%21) * [0(nop^)](%23/0%28nop%5E%29) @@ -442,6 +441,7 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib * [HQ9+](h/HQ9%2B.h) * [HQ9funge](h/HQ9funge) * [HTML](h/HTML.html) +* [HTTP](h/HTTP.py) * [Hubot](h/Hubot.coffee) * [Huf](h/Huf.huf) * [Hy](h/Hy.hy)