title: Spring: How to get parameters from POST body?
body: <p>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:-</p>
  
  <pre><code>source=”mysource”
  
  &amp;json=
  {
      "items": [
          {
              "username": "test1",
              "allowed": true
          },
          {
              "username": "test2",
              "allowed": false
          }
      ]
  }
  </code></pre>
  
  <p>And the web-service method looks like:-</p>
  
  <pre><code>@RequestMapping(value = "/saveData", headers="Content-Type=application/json", method = RequestMethod.POST)
      @ResponseBody
      public ResponseEntity&lt;Boolean&gt; saveData(@RequestBody String a) throws MyException {
          return new ResponseEntity&lt;Boolean&gt;(uiRequestProcessor.saveData(a),HttpStatus.OK);
  
      }
  </code></pre>
  
  <p>Please let me know how do I get the params from the body? I can get the whole body in my string but I don't think that would be a valid approach. Please let me know how do I proceed further.</p>