HTTP.sendAsynchronousRequest()

Signature

String sendAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationId, String successCallbackRuleFunctionURL, String errorCallbackRuleFunctionURL, String methodType, Object httpConnectionInfo)

Domain

ACTION

Description

Sends an secure/non secure asynchronous HTTP request. The requesting thread continues processing. The response is handled asynchronously in the callback rule function. The signature of the success RuleFunction should be $1void ruleFunction (String correlationId, Event request, Event response$1) whereas that of the error RuleFunction should be $1void ruleFunction (String correlationId, Event request, BEException exception)$1 where the request event is the event that initiated the request, the response event is the HTTP response mapped to an Event and correlationId is the correlationId that was specified in the original request or that was returned by the sendAsynchronousRequest function.

This function can also be used in SOAP requests. For SOAP requests, the SOAPAction will be taken from a corresponding event property, or, if this not present, the default destination of the request event will be used.

Parameters

NameTypeDescription
urlStringThe URL for the endpoint.
requestEventSimpleEventThe input event to send
correlationIdStringAn optional id to correlate request and response.
successCallbackRuleFunctionURLStringThe fully qualified path of a rule function to be invoked for success case.
errorCallbackRuleFunctionURLStringError case callback rulefunction. Can be null.
methodTypeStringThe HTTP method type, should be POST if the requestEvent's payload is not null
httpConnectionInfoObjectHTTP Connection Info object

Returns

TypeDescription
Stringthe correlation id