How use PUT method in Springboot Restcontroller?

前端 未结 5 1575
花落未央
花落未央 2021-02-09 14:37

Am developing an application using Spring boot.I tried with all representations verbs like GET, POST , DELETE all are working fine too. By using PUT method, it\'s not supporting

5条回答
  •  礼貌的吻别
    2021-02-09 15:01

    This code will work fine. You must specify request mapping in class level or in function level.

    @RequestMapping(value = "/student/info", method = RequestMethod.PUT)
    public @ResponseBody String updateStudent(@RequestBody Student student){
     LOG.info(student.toString());
     return "ok";
    }
    

提交回复
热议问题