Skip to Content
avatar image
Former Member

Get Response from outbound POST call in xsjs

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 16 at 12:12 PM

    Something like this:

    var response = client.getResponse();
    var body = response.body.asString();
    Add comment
    10|10000 characters needed characters exceeded

  • May 16 at 12:15 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • May 16 at 02:14 PM

    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

    Add comment
    10|10000 characters needed characters exceeded