A lightweight RESTful API for storing and retrieving key-value pairs in memory using Flask.
GET /store?key=<key>&value=<value>
Parameters:
key(required): The key to storevalue(required): The value to associate with the key
Success Response:
{
"status": "ok",
"key": "your_key",
"value": "your_value"
}Error Response (400 Bad Request):
{
"error": "missing key or value"
}GET /get?key=<key>
Parameters:
key(required): The key to look up
Success Response:
{
"key": "your_key",
"value": "your_value"
}Error Responses:
- Missing key (400 Bad Request):
{
"error": "missing key"
}- Key not found (404 Not Found):
{
"error": "not found",
"key": "non_existent_key"
}- Install the required dependency:
pip install flask- Run the application:
python index.pyThe server will start on http://0.0.0.0:8000