title: setting a parameter name in jquery Ajax request for json POST data
body: <p>I'm sending a POST request with json like this:</p>
  
  <pre><code>$.ajax({
       type: "POST",
       url: "myurl.htm",
       contentType: "application/json",
       data: '{"val1":"something","stuff":[{"val1":"value1","data":"Someone"}]}',
       dataType: "json"
  }); 
  </code></pre>
  
  <p>When I look at this requet from <code>Network</code> its passing the following payload</p>
  
  <p><code>{"val1":"something","stuff":[{"val1":"value1","data":"Someone"}]}</code></p>
  
  <p>However, I want the request load to be:</p>
  
  <p><code>mydata: {"val1":"something","stuff":[{"val1":"value1","data":"Someone"}]}</code></p>
  
  <p>Because my controller is accepting the following:</p>
  
  <pre><code> @RequestMapping(headers ={"Accept=application/json"},value="/myurl.htm", method= RequestMethod.POST)
   public ModelAndView mymethod(
        @RequestParam(value="mydata", required=false) String mydata {
    logger.info(mydata);
  }
  </code></pre>
  
  <p>So I need a way to simply give a parameter name to the json data I'm sending to the server as POST request. </p>