diff --git a/README.md b/README.md index 1817bc0b..d5bfe080 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EX01 Developing a Simple Webserver -# Date: +# Date:24-03-2025 # AIM: To develop a simple webserver to serve html pages and display the configuration details of laptop. @@ -21,6 +21,62 @@ Serving the HTML pages. Testing the webserver. # PROGRAM: +``` +from http.server import HTTPServer, BaseHTTPRequestHandler +content = """ + +
| s.no | +companies | +revenue | +
|---|---|---|
| 1 | +Microsoft | +65 billion | +
| 2 | +oracle | +29.6 billion | +
| 3 | +IBM | +29.1 billion | +
| 4 | +SAP | +6.4 billion | +
| 5 | +symentec | +5.6 billion | + + +""" +class myhandler(BaseHTTPRequestHandler): + def do_GET(self): + print("request received") + self.send_response(200) + self.send_header('content-type','text/html; charset=utf-8') + self.end_headers() + self.wfile.write(content.encode()) +server_address=('',8000) +httpd = HTTPServer(server_address,myhandler) +print("my webserver is running....") +httpd.serve_forever() +``` # OUTPUT: + + + + # RESULT: The program for implementing simple webserver is executed successfully.