Send JSON Object to Server through Ajax

  1. var jsonObj = {  
  2.     "key1""value1",  
  3.     "key2""value2"  
  4. }  
  5.   
  6. $.ajax({  
  7.     url: 'Service Url',  
  8.     type: 'POST',  
  9.     contentType: 'application/json; charset=utf-8',  
  10.     data: JSON.stringify(jsonObj),  
  11.     cache: false,  
  12.     success: function(result) {  
  13.         //success callback  
  14.     },  
  15.     failure: function() {  
  16.   
  17.     }  
  18. });