Spring - 405 此 URL 不支持 HTTP 方法 DELETE
2022-09-02 10:14:11
好吧,我在春季执行“DELETE”HTTP请求时遇到了一个奇怪的问题。
我有一个控制器方法,我已经将DELETE请求映射到:
@RequestMapping(value = "/{authorizationUrl}",method=DELETE)
public void deleteAuthorizationServer(
@RequestHeader(value="Authorization") String authorization,
@PathVariable("authorizationUrl") String authorizationUrl)
throws IOException {
System.out.println("TEST");
}
控制器是使用映射当我通过我的 DEV Http 客户端发送请求时,我得到的响应:。@RequestMapping("/authorization_servers");
405 Http method DELETE is not supported by this URL
请求如下所示:
DELETE localhost:8080/authorization_servers/asxas
Headers:
Authorization: "test:<stuff>"
如果有人能对此进行调查并帮助我,我将不胜感激