Use HTTP POST to retrieve body of response for SAIL form

Hello,

We want to write a rule that does an HTTP POST and gets the result from the body of the response. We also want to do this from a SAIL form. There is an example here
forum.appian.com/.../Connector_Functions.html

We think we have successfully followed the example but the example assumes that the POST is for a REST service and that in order to get the value back you are supposed to do a subsequent GET to the same service (the example uses bind to associate the GET and the POST to local variable) .

However in our case the response is already contained in the POST reponse and the is no associated GET available to call. Can we handle this integration pattern from within SAIL?

Regards,
Nikos

OriginalPostID-158196

OriginalPostID-158196

  Discussion posts and replies are publicly visible

Parents
  • You should be able to do this by passing a null value into the get parameter for bind. E.g., your expression will look something like:

    local!postData: bind(
    get: null,
    set: a!httpWrite(
    url: <your url>,
    method: "POST",
    body: <your post body>,
    headers: { a!httpHeader( <any headers> ) }
    )
    )

    It might also be helpful to look through some of the other examples on the connector functions page which use bind() to see other examples of how to use that function.
Reply
  • You should be able to do this by passing a null value into the get parameter for bind. E.g., your expression will look something like:

    local!postData: bind(
    get: null,
    set: a!httpWrite(
    url: <your url>,
    method: "POST",
    body: <your post body>,
    headers: { a!httpHeader( <any headers> ) }
    )
    )

    It might also be helpful to look through some of the other examples on the connector functions page which use bind() to see other examples of how to use that function.
Children
No Data