Question: Web server and a Web client in Python (part 2) THIS PART 2 OF A PREVIOUSLY POSTED QUESTION Part 2: Web Client You will develop
Web server and a Web client in Python (part 2)
THIS PART 2 OF A PREVIOUSLY POSTED QUESTION
Part 2: Web Client
You will develop a client which sends HTTP requests to your server and receives HTTP responses. Specifically, your client will
1) initialize a socket object,
2) get a URL input from the user,
3) establish a TCP connection to the server,
4) send a HTTP request according to the URL,
5) receive and parse the HTTP response from the server,
6) close the connection.
Your client should print out the status and the body content of the HTTP response. It should be able to handle the following:
Suppose your server's IP address is xxxx. Enter http://xxxx:8080/index.html in your client. The response status code should be 200, and the body should be the content of
index.html.
Request a file that is not in the server directory. The response status code should be 404.
Enter http://www.cse.psu.edu/gxc27/teach/362/index.html (in your client. The response status code should be 200, and the body should be the content of index.html.
.
Please be as detailed as possible and include:
1. A detailed description of your design, as well as the main functions.
2. A report of how your server works. You should include the HTTP requests and responses in your report.
3. Screenshots (e.g, lightshot) to show how your system works.
4. Well-commented source code.
5. Precise instructions on how to compile and run your code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
