今天遇到一个奇葩错误
{
"timestamp": 1540465525104,
"status": 405,
"error": "Method Not Allowed",
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
"message": "Request method 'GET' not supported",
"path": "/cno/disableBind"
}
百度了半天,一直以为是代码的原因,改来该去都不对。这是我的测试地址
后来查看NGINX的日志,才发现请求做了跳转
118.26.72.21 - sales01 [25/Oct/2018:19:01:08 +0800] "POST /crm-cti/cno/disableBind?userName=test HTTP/1.1" 301 185 "-" "PostmanRuntime/7.3.0" "-"
118.26.72.21 - sales01 [25/Oct/2018:19:01:08 +0800] "GET /crm-cti/cno/disableBind?userName=test HTTP/1.1" 405 230 "http://dev.xuebastudy.com/crm-cti/cno/disableBind?userName=test" "PostmanRuntime/7.3.0" "-"
原因很简单配置的域名是https的,在请求的时候没有带上https://默认跳转到http上,所以出现这样的错误。至于具体的原因就不太清楚了。