AJAX Post request
AJAX Post request

When sending data in POST request , as per most of the solutions , i used below code to send data and its passing correctly in request body. But the issue is the pagination parameteres like start and limit is not passing with this. ANy solution for this ?
data: function ( json ) {
return JSON.stringify( json );
}
This discussion has been closed.
Answers
That small code snippet doesn't give enough information to help. Are you using
ajax
withajax.data
or jQuery Ajax?What does JSON contain and where are the
start
andlimit
parameters being generated? Or are you referring to the parameters send by Server Side Processing?In order for us to understand what you have to offer suggestions please post a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
i am using AJax Option with AJAX data and uses
data: function ( json ) {
return JSON.stringify( json );
}
to pass data on request body
this passed JSON contains an Object which need to be passed to server.
Used .on('preXhr.dt', function ( e, settings, data ) to pass start and limit.. This is working on GET requests.
Here is the jsfiddle..
https://jsfiddle.net/Lkcnqyus/1/
if i remove JSON,stringify the parameteres added on preXhr will work correctly.but request body will not be formatted correctly.
Would something like this work?
https://jsfiddle.net/fke3byd9/
You are overwriting, not merging, the original data with
return JSON.stringify( fullData );
.Kevin