Question: Write a simple web server that recognizes only the GET request (without the Host: request parameter and blank line). When a client connects to your
Write a simple web server that recognizes only the GET request (without the Host:
request parameter and blank line). When a client connects to your server and sends a command, such as GET filename HTTP/1.1, then return a header HTTP/1.1 200 OK followed by a blank line and all lines in the file. If the file doesn’t exist, return 404 Not Found instead.
Your server should listen to port 8080. Test your web server by starting up your web browser and loading a page, such as localhost:8080/c:\cs1\myfile.html.
Step by Step Solution
3.37 Rating (147 Votes )
There are 3 Steps involved in it
Here is an example of a basic Python web server that will meet all the above criteria It will listen ... View full answer
Get step-by-step solutions from verified subject matter experts
