Re: [Dev] Internal Server Error when using the REST API.

2015-02-26 Thread Mohammed Fawsan
Hi Gimantha, It worked. Thanks a lot. -Cheers On Thu, Feb 26, 2015 at 5:35 PM, Gimantha Bandara wrote: > Hi Fawsan, > > Use JSON.Stringify on the data object submitted with POST. > > On Thu, Feb 26, 2015 at 4:04 PM, Mohammed Fawsan wrote: > >> CORRECTION : The JS function looks like this. >>

Re: [Dev] Internal Server Error when using the REST API.

2015-02-26 Thread Gimantha Bandara
Hi Fawsan, Use JSON.Stringify on the data object submitted with POST. On Thu, Feb 26, 2015 at 4:04 PM, Mohammed Fawsan wrote: > CORRECTION : The JS function looks like this. > > $(function(){ > $("#loginform").submit(function(e){ > > e.preventDefault(); > // var data = $("#logi

Re: [Dev] Internal Server Error when using the REST API.

2015-02-26 Thread Vinod Kavinda
Hi, Have you tried replacing $("#username").val() and $("#password").val() with just "admin". Maybe ajax request is getting invoked before initialising the data obj. I guess there is no guarantee data is initialised first, right? Regards, Vinod Kavinda On Thu, Feb 26, 2015 at 4:04 PM, Mohammed Fa

Re: [Dev] Internal Server Error when using the REST API.

2015-02-26 Thread Mohammed Fawsan
CORRECTION : The JS function looks like this. $(function(){ $("#loginform").submit(function(e){ e.preventDefault(); // var data = $("#loginform").serialize(); var data = {"username" : $("#username").val(),"password" : $("#password").val()}; alert(JSON.strin

[Dev] Internal Server Error when using the REST API.

2015-02-26 Thread Mohammed Fawsan
Hi, I am trying to authenticate a user via a HTML Form using AJAX. I'm trying to submit a HTML form to a REST API(created by pubudu) and it fails. I have several issues here. 1. I'm making a CORS request. ( My app resides in localhost:3000/login.html & My server resides in http://10.1