When I config dataModel with "contentType: 'application/json'" as:
dataModel: {
location: 'remote',
url: '/news',
contentType: 'application/json; charset=UTF-8',
postData: {"author":"jack", "isTopic": 1},
dataType: 'JSON',
method: 'POST'
}
I found pqgrid ajax send data is "x-www-form-urlencoded" format (author=jack&isTopic=1), not JSON-String payload format ({"author":"jack", "isTopic": 1}).
In fact, ajax should send JSON-String payload format data use JSON.stringify(postData) when contentType is "application/json".
Now, I must config beforeSend to reset send data format:
beforeSend: function(xhr, settings) {
settings.data = JSON.stringify({....});
}
Is this a bug?