Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

How to set the request body of POST service programatically?

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

Pavel Zarudniy
Posts: 0
Joined: Mon Jul 06, 2015 8:56 am

How to set the request body of POST service programatically?

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

Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

How to set the request body of POST service programatically?

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.

Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

How to set the request body of POST service programatically?

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

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

Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

How to set the request body of POST service programatically?

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.

Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

How to set the request body of POST service programatically?

Really? answered again? this if far from answered!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to set the request body of POST service programatically?

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.

Reynaldo Libutan
Posts: 0
Joined: Fri May 01, 2015 6:54 am

How to set the request body of POST service programatically?

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.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to set the request body of POST service programatically?

Reynaldo,

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

Return to “Issues”