Spring: How to get parameters from POST body?

前端 未结 6 908
庸人自扰
庸人自扰 2020-12-29 06:00

Web-service using spring in which I have to get the params from the body of my post request? The content of the body is like:-

source=”mysource”

&json=
         


        
6条回答
  •  囚心锁ツ
    2020-12-29 06:40

    You can get param from request.

    @ResponseBody
    public ResponseEntity saveData(HttpServletRequest request,
                HttpServletResponse response, Model model){
       String jsonString = request.getParameter("json");
    }
    

提交回复
热议问题