Spring: How to get parameters from POST body?

前端 未结 6 910
庸人自扰
庸人自扰 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:38

    In class do like this

    @RequestMapping(value = "/saveData", method = RequestMethod.POST)
     @ResponseBody
        public ResponseEntity saveData(HttpServletResponse response,Bean beanName) throws MyException {
            return new ResponseEntity(uiRequestProcessor.saveData(a),HttpStatus.OK);
    
    }
    

    In page do like this:

提交回复
热议问题