【发布时间】:2019-12-08 09:20:45
【问题描述】:
有没有什么方法可以传递一个带有斜线的字符串,例如这个函数:
import hug
@hug.get("/returnfilecontent/{path}")
def doubles(path):
return open(path, 'r').read()
我想访问http://localhost/returnfilecontent/foo/bar/myfile.md 以从位于foo/bar/myfile.md 的文件中读取内容。
似乎拥抱不behave well 带有路径,我只能传递像http://localhost/returnfilecontent/myfile.md 这样的非路径字符串
【问题讨论】: