gpt4 book ai didi

python - 我可以在 Python Bottle 中使用 PUT http 方法吗?

转载 作者:太空宇宙 更新时间:2023-11-03 12:50:15 25 4
gpt4 key购买 nike

我正在尝试这样做:

@get("/admin/questions/:question_id")
def question (question_id):
pass
#Some code for returning the question

@put("/admin/questions/:question_id")
pass
#I intend to write some code to update the question here.

这可能吗? GET 和 POST 有效,PUT 显然无效。

最佳答案

是的,你可以做到这一点。请参阅文档:

例子:

from bottle import put, run

@put("/foo")
def foo():
return "Foo"

run()

关于python - 我可以在 Python Bottle 中使用 PUT http 方法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11836342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com