yongchang
yongchang

Reputation: 522

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?

Upvotes: 0

Views: 313

Answers (1)

Hopey One
Hopey One

Reputation: 1816

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

Upvotes: 3

Related Questions