【发布时间】:2018-03-27 15:56:23
【问题描述】:
我在 AWS 中使用 Spring Boot 和 http 到 https 重定向,使用的是弹性 beanstalk。
所以我请求http然后重定向https,并通过https协议重新请求......
在 https 中,一切正常,
但是在 http 中,get 方法(在控制器中)可以,但是 post 方法不行...{
"timestamp": 1508137623531,
"status": 405,
"error": "Method Not Allowed",
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
"message": "Request method 'GET' not supported",
"path": "/api/test"
}
我的控制器代码@PostMapping(value = "/test")
public String test(@RequestBody String name) {
return "hello, " + name;
}
我试过this answer,但对我没有帮助...
我该如何解决它...?
【问题讨论】:
标签: amazon-web-services spring-mvc redirect spring-boot amazon-elastic-beanstalk