作者:迷迷糊糊的Nancy | 来源:互联网 | 2018-05-21 20:35
在框架内方法某个方法nginx报405错误StatusCode:405MethodNotAllowedRemoteAddress:102.224.214.168:80RequestURL:test.miyabaobei.comindex.phpwappaycenter-perpare_by_weixin.h...Requ...
在框架内方法某个方法 nginx 报 405错误 Status Code:405 Method Not Allowed
Remote Address:102.224.214.168:80
Request URL:http://test.miyabaobei.com/index.php/wap/paycenter-perpare_by_weixin.h...
Request Method:GET
Status Code:405 Method Not Allowed
回复内容:
在框架内方法某个方法 nginx 报 405错误 Status Code:405 Method Not Allowed
Remote Address:102.224.214.168:80
Request URL:http://test.miyabaobei.com/index.php/wap/paycenter-perpare_by_weixin.h...
Request Method:GET
Status Code:405 Method Not Allowed
通常出现405错误是请求的method和你的配置不符,举个例子:
Javascript
app.post('/some/thing', function() {});
如果我通过浏览器访问 /some/thing 肯定抛405异常,因为定义的路由仅支持POST方法。
看看路由啊什么的 什么框架啊。
很简单,你应该是用了backbone,或者类似 的前端框架。这种框架默认你的server是RESTful的,405,是你发起的请求不是post,是Put,你可以抓包看一下。如果你用的是backbone,可以回复我,我最近才解决的这个问题。