Skip to content

jorgepi/python-flask-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-flask-rest-api

My simple exercise playing with Flask Rest and Python

Example to build the Docker container:

docker build -t my-python-api .

Example to run the app:

docker run -d -p 5000:5000 my-python-api

Tests:

GET:

curl http://localhost:5000/user/Jorge

POST:

curl -X POST -H "Content-Type: application/json" -d '{"name": "Alfred", "age": 34, "occupation": "Cellist"}' http://localhost:5000/user/Alfred

PUT:

curl -X PUT -H "Content-Type: application/json" -d '{"name": "Tom", "age": 25, "occupation": "Tennis Player"}' http://localhost:5000/user/Alice

DELETE:

curl -X DELETE http://localhost:5000/user/Jorge

About

Rest API in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors