HTTP

Description

HTTP Client functions

Functions

NameSignature and Synopsis
createKeystoreObject createKeystore(String ksFilePath, String ksType, String ksPassword)
Creates and returns a Keystore object using the given parameters.
getPostDataObject getPostData(SimpleEvent event)
This method returns post data sent in HTTP post request as a byte[] wrapped inside an Object
loadTrustedCertificatesObject loadTrustedCertificates(String trustedCertsFolder,String passwordToSet)
Loads and returns a Certificate object using the trusted certificates folder.
sendAsynchronousRequestString sendAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationId, String callbackRuleFunctionURL, String methodType)
Send an asynchronous HTTP request.The requesting thread continues processing. The response is handled asynchronously in the callback rule function. The signature of the rule function should be "void ruleFunction (String correlationId, Event request, Event response") where the request event is the event that initiated the request, response is the HTTP response mapped to an Event and correlationId is the correlationId as specified in the original request or that returned by the sendAsynchronousRequest function. This function can also be used to send SOAP requests. For SOAP requests, the SOAPAction will be taken from a corresponding event property or if not present, the default destination of the request event will be used.
sendRequestEvent sendRequest(String url,SimpleEvent requestEvent, String responseEventURI, long timeoutMillis)
Send a synchronous HTTP request. The requestEvent properties and payload are converted to HTTP headers and POST data respectively. If event payload is null, HTTP GET will be used, else HTTP POST will be used. This will return an event of type responseEventURI as a response encapsulating response headers as properties and post data if any as event payload. This function can also be used to send SOAP requests. For SOAP requests, the SOAPAction will be taken from a corresponding event property or if not present, the default destination of the request event will be used.
sendSecureAsynchronousRequestString sendSecureAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationId, String callbackRuleFunctionURL, String methodType, Object clientIdKeystore, String clientIdPassword ,Object trustedCertsKeystore, String trustedCertsPassword, boolean verifyHostName)
Send an asynchronous HTTP request over SSL. The requesting thread continues processing.The response is handled asynchronously in the callback rule function. The signature of the rule function should be "void ruleFunction (String correlationId, Event request, Event response)". where the request event is the event that initiated the request, response is the HTTP response mapped to an Event and correlationId is the correlationId as specified in the original request or that returned by the sendAsynchronousRequest function This function can also be used to send SOAP requests. For SOAP requests, the SOAPAction will be taken from a corresponding event property or if not present, the default destination of the request event will be used.
sendSecureRequestEvent sendSecureRequest(String url, SimpleEvent requestEvent, String responseEventURI, Object clientIdKeystore, String clientIdPassword, Object trustedCertsKeystore, String trustedCertsPassword, boolean verifyHostName,long timeoutMillis)
Send an synchronous HTTP request over SSL. The requestEvent properties and payload are converted to HTTP headers and POST data respectively. If event payload is null, HTTP GET will be used, else HTTP POST will be used. This will return an event of type responseEventURI as a response encapsulating response headers as properties and post data if any as event payload. This function can also be used to send SOAP requests. For SOAP requests, the SOAPAction will be taken from a corresponding event property or if not present, the default destination of the request event will be used.