Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josemartin357/python-api
This is a personal refresher on how APIs are built with Python. For this project, I am only using the Python modules; not frameworks.
https://github.com/josemartin357/python-api
Last synced: 4 days ago
JSON representation
This is a personal refresher on how APIs are built with Python. For this project, I am only using the Python modules; not frameworks.
- Host: GitHub
- URL: https://github.com/josemartin357/python-api
- Owner: josemartin357
- License: mit
- Created: 2023-11-04T00:33:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-04T00:40:25.000Z (about 1 year ago)
- Last Synced: 2023-11-04T01:38:14.265Z (about 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-api
This is a personal refresher on how APIs are built with Python. For this project, I am only using the Python modules; not frameworks.
A future update to this project will include authorization and other features.## To run
In Root folder of this repo, run `python api.py` in your Terminal. That will initiate the server and you will see the message `Starting server on port 8000`.
## Example of API calls using Curl
**GET**
`curl http://localhost:8000/api/items`
`curl http://localhost:8000/api/item/1`
**POST**
`curl -X POST -H "Content-Type: application/json" -d '{"name": "John", "description": "A cool dude"}' http://localhost:8000/api/items`
**PUT**
`curl -X PUT -H "Content-Type: application/json" -d '{"name": "Updated Item 3", "description": "This is the updated item 3"}' http://localhost:8000/api/item/3`
**DELETE**
`curl -X DELETE http://localhost:8000/api/item/3`