87.4k views
1 vote
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

1 Answer

1 vote

Final answer:

To test your server, create your own HTTP client that connects via TCP and sends a GET request. The client should display the server's response as output.

Step-by-step explanation:

In this question, you are asked to create your own HTTP client to test your server. To accomplish this, you will need to establish a TCP connection to the server and send an HTTP request. The server will then respond with the requested object, which you will display as output.

The command line arguments for your client should include the server's IP address or hostname, the port at which the server is listening, and the path of the requested object. The HTTP request sent should be a GET method.

For example, to run the client you would use the command:

python client.py server_host server_port filename

User Ali Saeed
by
8.4k points