ani*_*jha 7 python-3.x starlette fastapi
我试图编写一个 fastapi post 方法:
@app.post('/method/final_path/', tags=['method/final_path'])
Run Code Online (Sandbox Code Playgroud)
当我以https://......./method/final_path/进行邮递员调用时,
我得到了预期的结果,但如果调用更改为 https://......./method/ Final_path
我收到 405-method not allowed。
根据 FastAPI 文档,尾部斜杠应该无关紧要,所以理想情况下
@app.post('/method/final_path/', tags=['method/final_path'])
@app.post('/method/final_path', tags=['method/final_path'])
Run Code Online (Sandbox Code Playgroud)
与邮递员电话:
所有上述 4 种组合应该给出相同的结果。那我做错了什么?
版本:
fastapi-0.63
starlette-0.13.6
提前致谢。
| 归档时间: |
|
| 查看次数: |
5507 次 |
| 最近记录: |