S
S
ssssergey2017-06-10 12:49:43
Python
ssssergey, 2017-06-10 12:49:43

How to reach the POST method in CBV in aiohttp?

route

app.router.add_get('/upload', UploadView, name='upload')

view
class UploadView(web.View):
    @aiohttp_jinja2.template('upload.html')
    async def get(self):
        return {}

    async def post(self):
        return {}

GET finds, but POST does not. Mistake
405: Method Not Allowed

Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Romua1d, 2021-03-16
@Romua1d

Use notapp.router.add_get
Aapp.router.add_view

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question