Question: You should use Python 3 in this assignment. The goal for this assignment is to build a server that stores key-value pairs. The full client
You should use Python 3 in this assignment. The goal for this assignment is to build a server that stores key-value pairs. The full client program and a skeleton server program will be given to you. The client should be able to send requests to the server and receive answers from it. Bound your server to IP 0.0.0.0.
The server must accept the following requests:
Request Format (the COMMAND should be case-insensitive) - GET key - this requests the value associated with key - The response code is 404 if the key doesnt exist - PUT key value - this requests that the server associates value with key - DELETE key - this removes the key-value pair from the table - Even if key is not stored, the response code can be 200 OK - CLEAR - this clears the table of all key-value pairs - QUIT - will gracefully terminate the connection and
let the server accept another one :
Response Format - Responses usually have a code in the header to report the operation status - 200 OK - request is valid and has been completed - 220 UNSUPPORTED - operation not recognized - 400 BAD_REQUEST - operation recognized, but not properly formatted (missing/invalid args, etc.) - 404 NOT FOUND - specified key was not found for GET Python makes the storing of key-value pairs very easy with the dictionary.
Your program should essentially create the socket, continuously loop while checking for request, parse any incoming requests, and perform the appropriate action.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
