我可以在Python瓶子中使用PUT http方法吗?
我正在尝试这样做:我可以在Python瓶子中使用PUT http方法吗?,python,rest,bottle,Python,Rest,Bottle,我正在尝试这样做: @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和POS
@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-do-work,PUT显然不起作用。我发现这个:。它可能有用。是的,你可以这样做。请参阅文档:
from bottle import put, run
@put("/foo")
def foo():
return "Foo"
run()
我也有同样的问题。上面的链接很有帮助。我还发现这些网页很有用: (weekend code warrior在一个页面中创建restful界面——这对我来说非常清楚) 一旦我花时间浏览了这些页面,它就非常容易实现