我在Spring中执行"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");
}
Run Code Online (Sandbox Code Playgroud)
控制器使用@RequestMapping("/authorization_servers");
当我通过我的DEV Http客户端发送请求时映射,我收到响应:405 Http method DELETE is not supported by this URL.
请求如下所示:
DELETE localhost:8080/authorization_servers/asxas
Headers:
Authorization: "test:<stuff>"
Run Code Online (Sandbox Code Playgroud)
如果有人可以调查并帮助我,我将不胜感激