JQuery Post sends form data and not JSON

With JSON.stringify(object)

Sample:

$.ajax({
    type: 'POST',
    url: '<url>',
    contentType: 'application/json; charset=utf-8',
    dataType: 'json',
    data: JSON.stringify(object)
});

Note JSON.stringify is not supported in all browsers (http://caniuse.com/#feat=json ), in particular browsers IE7 and lower.

If you need to support this browsers too you can use this Javascript library: https://github.com/douglascrockford/JSON-js

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)