Pyramid Replacing Double Forward-Slash in URL Matchdict

爱⌒轻易说出口 提交于 2019-11-29 16:48:58

This is a fundamental limitation of any WSGI-based application. URLs are urldecoded and slashes are compacted before the URL is passed to the WSGI app. If you want to preserve the slashes you will need to urlencode them twice. AFAIK there is no way around this using a query string.

I guess I should point out that the original URL is available, but from it you will have to parse out the part you care about yourself. It is in request.url. request.path_info is what Pyramid and most WSGI apps use to dispatch URLs because it contains only the sub-path that is relative to where the app is mounted.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!