https://github.com/shawon922/flask-blog-api
A simple API built with flask, flask-restful and flask-mysqldb.
https://github.com/shawon922/flask-blog-api
flask flask-api flask-restful python python3
Last synced: 10 months ago
JSON representation
A simple API built with flask, flask-restful and flask-mysqldb.
- Host: GitHub
- URL: https://github.com/shawon922/flask-blog-api
- Owner: shawon922
- Created: 2017-05-06T10:38:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-06T13:57:33.000Z (over 8 years ago)
- Last Synced: 2025-01-05T17:43:11.480Z (12 months ago)
- Topics: flask, flask-api, flask-restful, python, python3
- Language: Python
- Size: 1.95 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flask-blog-api
## A simple API built with "flask", "flask-restful" and "flask-mysqldb".
#### Tutorial Reference
[REST API Best Practices: Python & Flask Tutorial - Polyglot.Ninja()](http://polyglot.ninja/rest-api-best-practices-python-flask-tutorial/)
### Requirements
Flask==0.12.1
Flask-MySQLdb==0.2.0
Flask-RESTful==0.3.5
### To create an article:
```
$ curl -H "Content-Type: application/json" -X POST -d '{"title": "This is title", "content": "This is content"}' http://127.0.0.1:5000/api/v1/articles/
```
### To get all articles:
```
$ curl -X GET http://127.0.0.1:5000/api/v1/articles/
```
### To get a single article:
```
$ curl -X GET http://127.0.0.1:5000/api/v1/articles/1
```
### To update an article:
```
$ curl -H "Content-Type: application/json" -X PUT -d '{"title": "This is title", "content": "This is content"}' http://127.0.0.1:5000/api/v1/articles/9
```
### To delete an article:
```
$ curl -X DELETE http://127.0.0.1:5000/api/v1/articles/8
```