post method requires 'GET'
This commit is contained in:
parent
ac9770dd89
commit
96c13fe23c
|
@ -51,6 +51,8 @@ app = Sanic('peewee_example')
|
||||||
|
|
||||||
@app.route('/post')
|
@app.route('/post')
|
||||||
async def post(request):
|
async def post(request):
|
||||||
|
""" This is actually a GET request, you probably want POST in real life,
|
||||||
|
with some data parameters"""
|
||||||
obj = await objects.create(KeyValue, key='my_first_async_db', text="I was inserted asynchronously!")
|
obj = await objects.create(KeyValue, key='my_first_async_db', text="I was inserted asynchronously!")
|
||||||
return json({'object_id': obj.id})
|
return json({'object_id': obj.id})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user