Search code examples
javaspringhttp-deletehttp-status-code-405

Delete requestmapping is throwing me this error 405 Http method Get is not supported by this URL


Below is my method to delete and return a string, simple and straightforward

@RequestMapping(value = "/deletetest", method = RequestMethod.DELETE)
    @ResponseBody
    public String DeleteUser() {
        return "something";
    }

But I go Get method not supported, which is weird since i state that my method = RequestMethod.DELETE enter image description here

Any insight?


Solution

  • If you set an endpoint to RequestMethod.DELETE the endpoint will only accept a HTTP DELETE request. Your browser issues a GET request.