I am getting a Request method \'PUT\' not supported
error on hitting a PUT method on a restful API to upload a file.
Following is the
Chek you request mapping
if you declare request mapping in class level @RequestMapping("/api/users")
then if you declare mapping in method level @RequestMapping("/api/users/{id}")
this error could occur.
correct
@RequestMapping("/api/users")
public class {.....
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
update(....)
}
incorrect , might cause PUT not supported error
@RequestMapping("/api/users")
public class {.....
@RequestMapping(value = "/api/users/{id}", method = RequestMethod.PUT)
update(....)
}