Page 1 of 1

How to POST javascript object to service?

Posted: Mon Jul 20, 2015 8:30 am
by Reynaldo Libutan

For example I have created a service like below

Image

and I have a javascript object like

code
var param = {
// has a lot of fields
// some fields are arrays of objects
}
/code

How do i use codeparam/code like below?

code
myServiceInst.execute({
parameters: {
// how do I use it here???
// for non-obj fields i just use something like below
// field: value
},
success: function(response) {
console.log(response);
},
error: function() {
alert("No internet connection or a server error occured.");
}
});
/code


How to POST javascript object to service?

Posted: Mon Jul 20, 2015 9:50 am
by Pavel Zarudniy

Hi Reynaldo,
Please look at example below:
code
myServiceInst.execute({
parameters: param,
...
/code


How to POST javascript object to service?

Posted: Mon Jul 20, 2015 11:15 pm
by Reynaldo Libutan

Hi, I tried what you suggested but I am getting this error.

Image


How to POST javascript object to service?

Posted: Tue Jul 21, 2015 12:10 am
by Reynaldo Libutan

I found out that in the function code__performParametersSubstitutions()/code of codeappery.js/code the code fails because

  1. my codeparam/code object has a non string property (easily fixed but still annoying)

  2. my codeparam/code object has a property of an array of objects

    Any tips how can I include this complex object as param for my service?


How to POST javascript object to service?

Posted: Tue Jul 21, 2015 12:28 am
by Reynaldo Libutan

Please remove the "answered" tag since this is obviously still unanswered.
Please see additional details below.


How to POST javascript object to service?

Posted: Tue Jul 21, 2015 10:48 am
by Pavel Zarudniy

Please share - http://devcenter.appery.io/documentat... your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the following information:

1) App name
2) Test credentials if login functionality is implemented in your app
3) Detailed steps to reproduce the issue