I\'m developing a website who uses an external Drupal for the articles and pages. The purpose is to show the articles in a website using just html/css/js.
I\'ve adde
might need to enable that parser type?
check this link out. maybe it will help you get some ideas https://drupal.stackexchange.com/questions/3207/simple-rest-request-to-create-nodes
You have to enable application/x-www-form-urlencoded content type of your service endpoint.
Do as follows: Services -> Edit Resources -> select tab "Server" -> enable "application/x-www-form-urlencoded" and that's it
Found the solution myself. For those who are interested :
$.ajax({
url : "http://127.0.0.1/restdrupal/restpoint/user/login.json",
type : 'post',
data : 'username=' + encodeURIComponent(username) + '&password=' + encodeURIComponent(password),
dataType : 'json',
error : function(data) {
//error code
},
success : function(data) {
//success code
}
});