Skip to Content
0

Get Response from outbound POST call in xsjs

May 16 at 09:08 AM

51

avatar image
Former Member

Hello All,

I'm calling a REST URL of a POST service in an xsjs service. I'm able to get the status of the response but I need to get the response body of the POST call. Can anyone please help me with this?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Thomas Jung
May 16 at 12:12 PM
1

Something like this:

var response = client.getResponse();
var body = response.body.asString();
Share
10 |10000 characters needed characters left characters exceeded
Florian Pfeffer
May 16 at 12:15 PM
0

You get back a $.web.WebResponse which contains a property "body" beside the property "status" your are using to get the status. Within the body property you will find your expected value.

Share
10 |10000 characters needed characters left characters exceeded
Sergio Guerrero May 16 at 02:14 PM
0

how about a link to the official documentation with an example:

https://help.sap.com/viewer/b3d0daf2a98e49ada00bf31b7ca7a42e/1.0.12/en-US/73cf0393c85b467eb948edba5cdad014.html

maybe fit it to your need since the yahoo service is no longer available

Share
10 |10000 characters needed characters left characters exceeded