jquery - AJAX gives 400 bad request error -


the post request returns 400 bad request error if test on rest client gives 200..

below ajax call

url

var ajaxurl = "/json/accounts/tallysales"; var enddate = $('#daterangeend').val(); var startdate = $('#daterangestart').val();     $.ajax({     url: ajaxurl,     type: "post",     data: json.stringify(jsondata),     contenttype: "application/json",     datatype: 'json',     success: function(data) {         if ((data.tallysales !== undefined) && (data.tallysales.length > 0)) {             populatejqgrid(data.tallysales, data.totalrecords);         } else {             $("#searchresultgrid").jqgrid("cleargriddata");              smoke.alert(data.message);             //smoke.alert("no data found current search paramters");         }         $(".dosearch").each(function() {             $(this).html($(this).val());         });         $(".dosearch").removeattr("disabled");     },     error: function() {         $(".dosearch").each(function() {             $(this).html($(this).val());         });         $(".dosearch").removeattr("disabled");     } }); 


Comments