Skip to content

Instantly share code, notes, and snippets.

@aishwarydhare
Created December 10, 2021 09:28
Show Gist options
  • Save aishwarydhare/3f8b31c5e97eef31fb5476537a43ea19 to your computer and use it in GitHub Desktop.
Save aishwarydhare/3f8b31c5e97eef31fb5476537a43ea19 to your computer and use it in GitHub Desktop.
from http.server import BaseHTTPRequestHandler, HTTPServer
class SampleHTTPServerHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
print(self.headers)
received_guid = self.headers['Access-Control-Expose-Headers']
self.wfile.write(bytes(f"r: {received_guid}", "utf8"))
with HTTPServer(('0.0.0.0', 8095), SampleHTTPServerHandler) as server:
server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment