An application which manages messages and provides details about those messages, specifically whether or not a message is a palindrome. Your application should support the following operations:
- Create, retrieve, update, and delete a message.
- List messages. These operations follows proper RESTful design.
YOU CAN EITHER RUN WITH DOCKER OR FOLLOW THE STEP BY STEP PROCESS TO SETUP VIRTUAL ENVRONMENT FOR THE RESTAPI
docker build -t newbuild .
docker run newbuild
skip to "MAKE REQUEST" section
pip install virtualenv
virtualenv -p python3 qlinkrest
source qlinkrest/bin/activate
(qlinkrest) $ pip install flask requests
Ensure you are in the code files directory:
(qlinkrest) $ python test.py
Ran 0 tests in 0.000s
OK
(qlinkrest) $ python qlink.py
- Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
(base) $ source qlinkrest/bin/activate
if you are not in the directory containing the code, navigate there.
(qlinkrest) $ python
import requests
response = requests.get("http://127.0.0.1:5000")
response.json()
(EXAMPLE - A message “Ayoola Makinde”)
response = requests.get("http://127.0.0.1:5000/qlink/Ayoola Makinde")
response.json()
(EXAMPLE - Create a message “I live in Guelph”)
response = requests.post("http://127.0.0.1:5000/qlink", json={"I live in Guelph":" "})
response.json()
EXAMPLE - Change the message “Cross River State” to "University of Dallas")
response = requests.put("http://127.0.0.1:5000/qlink/Cross River State", json={"University of Dallas":" "})
response.json()
(EXAMPLE - A message “Ayoola Makinde”)
response = requests.delete("http://127.0.0.1:5000/qlink/Ayoola Makinde")
response.json()