405 Method Not Allowed The method POST is not allowed for this resource appengine facebook App

吃可爱长大的小学妹 提交于 2019-12-10 22:35:51

问题


I'm doing an app on appengine and it works just fine there .I have the app's URL on facebook canvas url http://xx.appspot.com/yyy/ (with trailing slash) and when the app is called from http://apps.facebook.com/appname i get

405 Method Not Allowed The method POST is not allowed for this resource.

class MainHandler(webapp2.RequestHandler): def get(self): #do stuff here def post(self): pass

app = webapp2.WSGIApplication([ ('/yyy/', MainHandler), ('/',anotherHandler),

], debug=True )

note : no such error in appengine log .


回答1:


It's trying to make a POST to your app but you do not have a handler configured to receive it.

Where you have your GET handler:

 def get(self):
     dostuff

you also need to have a POST hander as well:

def post(self):
    dostuff

From what I remember when I last looked at this, it's probably trying to complete a step in the authorisation process or send you some data.




回答2:


Good Day !

It seems like I FINALLY figured out what my problem was . I defined the post method in the application as Paul C(which is correct) has mentioned but I was still getting the same 405 error message . The reason was ,I didn't update the default version of the app that was running from the appengine dashboard & updated my app version.

please make sure which version of the app you are using if you have the same problem. https://appengine.google.com/deployment?app_id=s~APP_ID&version_id=default:

I hope no one goes through this same experience I did. Thanks all.



来源:https://stackoverflow.com/questions/13346309/405-method-not-allowed-the-method-post-is-not-allowed-for-this-resource-appengin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!