Question: You have to make a local webserver in python which will be able to do the following: (i) Take client HTTP requests for a file
You have to make a local webserver in python which will be able to do the following: (i) Take client HTTP requests for a file (Readme.txt). Use browser for demonstration. (ii) Send the contents of the file back to client in a HTTP Response message(Show it in browser)[Attach screenshot] (iii) If the file is not found in the server, send a 404 File Not Found HTTP Response message back to client. ============================================== (iv) Now, instead of using a browser, write your own HTTP client to test your server. Your client will connect to the server using a TCP connection, send an HTTP request to the server, and display the server response as an output. You can assume that the HTTP request sent is a GET method. The client should take command line arguments specifying the server IP address or host name, the port at which the server is listening, and the path at which the requested object is stored at the server. The following is an input command format to run the client. client.py server_host server_port filename Refer to lab manual Page [32,33] where we have provided the python framework for the webserver. Marks 10% Submission: 1) You have to rename the python files as follows: ID_filename Ex: 0111151123_webserver.py 0111152099_webclient.py 2) Put the python file and the screenshot of the file in browser in a folder, zip it and submit it in elms in the window opened for submission within the given date.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
