It doesnt work. Appreciate your advice here
$.ajax({
url: "http://community.yoch.tv/posts/",
type: 'POST',
dataType: 'json',
//contentType: 'application/json', //that brings 400 mistake, doesnt look that DS accepts THAT contentType
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
processData: false,
data: { title: "New Topic Title with json data to check", category: "uncategorized", raw: "It might work with json POST. But it's not." },
//that brings "Failed to load resource: the server responded with a status of 422 (Unprocessable Entity)
success: function (data) {
console.log(JSON.stringify(data));
},
error: function(){
console.log(JSON.stringify(data));
console.log("Cannot get data");
}
});