当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Why aiohttp not allows colon in url path?

问题描述:

I am creating a telegram bot that gets an updates via webhook.

So, i am successfully registered the webhook with url looks like:

https://my-app.herokuapp.com/123456789:aglbfiwefiuwehwelf # url with fake token

And then i added a route to handle an update:

app.router.add_route('POST', '/123456789:aglbfiwefiuwehwelf', webhook)

The bot hosted on heroku and when i run it, i see a 404 error in a heroku log. I tested it locally and i found out that aiohttp not resolves the url with colon. I solved this problem by using a variable

app.router.add_route('POST', '/{token}', webhook), but i am interested in why actually aiohttp not allows a colon in url path?

分享给朋友:
您可能感兴趣的文章:
随机阅读: