REST API using python and flask. Data stored in mongodb
mkvirtualenv python-flask-mongodb
workon python-flask-mongodb
pip3 install -r requirements.txt
mongod
mongo
use python_flask_mongodb
python3 application.py
http://127.0.0.1:5000/
curl -XPOST http://localhost:5000/api/v1/user -H "Content-Type: application/json" -d '{
"name": "Abhinayak Swar",
"location": "Nepal"
}'
curl -XPOST http://localhost:5000/api/v1/user -H "Content-Type: application/json" -d '[
{
"name": "Atul Pradhan",
"location": "Nepal"
},
{
"name": "Pramod Sthapit",
"location": "Nepal"
}
]'
curl -XGET http://localhost:5000/api/v1/user
curl -XPUT http://localhost:5000/api/v1/user/{user_id} -H "Content-Type: application/json" -d '{
"name": "Abhinayak Swar 123",
"location": "Nepal"
}'
curl -XDELETE http://localhost:5000/api/v1/user/{user_id}