我正在尝试构建 REST API。(第一次尝试)
对于我的删除和放置
class DeletePost(webapp2.RequestHandler):
def delete(self):
postKey = self.request.get('postKey')
if(postKey != ""):
db.delete(postKey)
return
上面的代码不起作用。为了让它工作,我必须把它改成def get(self):
Html 是
<form action="/deletePost" method="delete" class="form-search">
<div class="row-fluid">
<legend>Title:</legend>
<input type="text" name = "postKey" class="input-xxlarge span12" placeholder="briefly describle this event"><br>
<input type="submit" value="Post" class="btn btn-large btn-primary pull-right" type="button">
</form>
我得到的错误是
405 Method Not Allowed
The method GET is not allowed for this resource.
感谢您的澄清。