Page 1 of 1

How to set the request body of POST service programatically?

Posted: Wed Jul 22, 2015 10:25 am
by Reynaldo Libutan

I have a service which works as expected using the codeTest/code button, I'd like to know how to set the body of the request when programatically calling the service. Please see settings below:

Image

Image

I am calling it like this but this doesn't work. P.S. codedataObj/code is just an object and I want to pass it as a JSON string.

code
saveResponseServiceInst.execute({
body: {
"data" : JSON.stringify(dataObj)
},
success: function(response) {
console.log(response);
},
error: function() {
alert("No internet connection or a server error occured.");
}
});
/code


How to set the request body of POST service programatically?

Posted: Wed Jul 22, 2015 10:38 am
by Pavel Zarudniy

Hi Reynaldo,
Try use data param instead body, also this doc will be helpful -
https://devcenter.appery.io/documenta...


How to set the request body of POST service programatically?

Posted: Wed Jul 22, 2015 11:28 am
by Reynaldo Libutan

Can you please specifiy? If I use codeparameter/code it will be included in the query string, i dont want that because my data is too long.


How to set the request body of POST service programatically?

Posted: Wed Jul 22, 2015 12:03 pm
by Reynaldo Libutan

I tried it already but I am getting this error like here in the link below.

http://stackoverflow.com/questions/31...


How to set the request body of POST service programatically?

Posted: Thu Jul 23, 2015 1:35 am
by Reynaldo Libutan

Any news on this? I am currently on a deadline.

Please bear in mind that the "Test" functions works as expected. If only I can recreate how the "Test" button works in my code.


How to set the request body of POST service programatically?

Posted: Thu Jul 23, 2015 7:27 am
by Reynaldo Libutan

Really? answered again? this if far from answered!


How to set the request body of POST service programatically?

Posted: Thu Jul 23, 2015 7:31 am
by Alena Prykhodko

Reynaldo,

Answered status is automatically added after reply.
We are working on your request and post an update as soon as possible.

Please show us screen shot of the error.


How to set the request body of POST service programatically?

Posted: Thu Jul 23, 2015 7:35 am
by Reynaldo Libutan

Ok, maybe I just misunderstood the meaning of "Answered". Sorry.

As I already mentioned, here is the details of the error and screenshots also.

http://stackoverflow.com/questions/31...

Thanks.


How to set the request body of POST service programatically?

Posted: Sun Jul 26, 2015 7:59 am
by Alena Prykhodko

Reynaldo,

Sorry, but references are broken, please show us error screen shot, as you see it in builder.