Could you check if it works with any other REST client? Please also check if it works in browser?
Could you check if it works with any other REST client? Please also check if it works in browser?
Try using content-type=x-www-form-urlencoded in Appery.io
Yep, that did the trick !!
Tnx for clearing this out for me.
Just one more question ...........
I got in the test tab the following response:
{
"error":true,
"message":"Sorry, this email already existed"
}
How can I get this error into the app?
I read that I must add the following Javascript on the service Error callback:
var response = JSON.parse(jqXHR.responseText);
alert(response.description);
But I can't find the service Error callback .....
Where exactly can I find this so I can add the Javascript?
I try to set this in the Pages -- Add event -- Select the component and give this the event Error but this seems not be the solution ....
Kind regards,
Arie
Hello!
You can use this code in any JS event handler.
For example on button click:
See details: http://prntscr.com/4jeenb/direct
It's best way to understand how to work with this tool to pass this tutorial: http://devcenter.appery.io/tutorials/...
Hello, I got an NaN error when setting this one like the image you give me.
But I think it isn ́t really what I want, this solution isn ́t giving me the response of the signup services.
In http://www.wijhoudenvanvoetbal.nl/app... there are some standard error response such as ́email already exist ́ or ́you must fill this field ́
When I go to the Test tab in the service http://www.wijhoudenvanvoetbal.nl/app... I get this response if I don't fill in anything, just hitting the submit button:
{
"status":"400 Bad Request",
"url":"http://www.wijhoudenvanvoetbal.nl/app...",
"response":{
"error":true,
"message":"Required field(s) name, email, password is missing or empty"
}
}
How can I get these response errors in an app?
Kind regards,
Arie
Hi Koning,
You can add "Success" event handler to the datasource of your service and populate it with following code:
pre
//print all response to the console.
console.log(data);
//print "data.response.message" to console.
console.log(data.response.message);
/pre
Regards.
Tnx for answering but unfortually that doesn't work for me ....
I have put this javascript in Pages -- signup -- Data tab -- Component: login, Event: Error, Action: Run javascript, Details: your javascript
When I test this in the browser, the spinner is is going round and round with no ending .........
Any idea what goes wrong?
Hello!
Are there any errors in console?