有没有办法在拥抱中传递一个带有斜杠的字符串,例如使用这个函数:
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
.
似乎拥抱在路径上表现不佳,我只能传递非路径字符串,例如http://localhost/returnfilecontent/myfile.md