how to hit server using ajax with post method
<p>Here is my html code</p>

<pre><code>          function loadDoc(){
 var num = '{"empid": 45,"name": "gaurav","salary":566.55}';
  $.ajax({

url: 'http://localhost:9029/addS',
method: 'POST',
data: num,
success: function(response){
      console.log("response::::"+response);
      $("#output").text(response);
},

error: function( jqXHR,textStatus, errorThrown){

    console.log("Error askdjk");
    console.log(jqXHR);
    console.log(textStatus);
    console.log(errorThrown);
}

  });   
}
</code></pre>

<p>Below is my java code </p>

<pre><code>     @RequestMapping(value="/addS",method={RequestMethod.POST})

     public String addEmployee(@RequestParam int empid,@RequestParam String name,@RequestParam double salary){

    return "employee added successfully(Separate): "+name;
}
</code></pre>

<p>M getting error 400 ...i tried many thing but not able to solve the problem .....</p>