The HTTP Client function enables communication with a third-party HTTP server and determines how to handle outgoing requests. This function supports REST API and also supports authentication via the OAuth 2.0 framework. The following HTTP Client functions are available in :
- Collector
- Processor
- Forwarder
The options available under General Settings and Advanced Settings that are applicable to HTTP Client Collectors, Processors, and Forwarders are mentioned below. The options specific to the individual functions are mentioned under the corresponding sections:
General Settings
In General Settings, enter the following details:
Select an HTTP request method from the following options:
HTTP Method Description GET Requests data from the target server POST Sends data to the target server. Select either Body or Form under Content* PUT Replaces current resources of the target URL with the uploaded content. Select either Body or Form under Content* PATCH Updates partial resources of the target URL. Select either Body or Form under Content* DELETE Removes all current representation of the target resource Note!
*The Body and Form fields are visible only for request methods POST, PUT and PATCH.The form input needs to be URL encoded, otherwise, it fails.
HTTP requests use a hardcoded content-type value of ‘application/x-www-form-urlencoded’.
- Select Body or Form and add the corresponding details in the content of the request message. You can use Variable Insertion.
- Expand the examples below to view samples of HTTP request messages for Body or Form:
- Select Body or Form and add the corresponding details in the content of the request message. You can use Variable Insertion.
Select the Authentication Type from the following. Depending on the users' configuration, two authentication methods are available: Basic Authentication and OAuth 2.0 implementation. Click on the respective tab to know more.
In Target URL, enter the URL of the target HTTP server. You can use Variable Insertion. You can select a combination of the following options to be included in the URL:
Option Description Include basic access authentication credentials Select to add the specified username and password Include query string in URL Select to include a query string in the URL. Add a key and its corresponding value. You can include multiple query strings. Customize header Select to customize the headers of the URL and specify multiple keys and their respective values.
The default value for the HTTP headers “content-type” and “accept” is application/json.
You can override the default value for HTTP header “content-type”.
It is recommended that the default value for HTTP header "accept" is left unchanged. The HTTP functions only support application/json.
Advanced Settings
In Advanced Settings, enter the following details that determine how you want to handle the errors. The following options are available for HTTP Collector and Processor functions only:
In Action on error, specify the action you want to take in case of an error. You can select from the following options:
Action on error options Description Ignore Select to ignore the error and the stream keeps on running
Stop the stream Select to stop the stream Any response with the HTTP status code as 4xx or 5xx is considered as an error. All errors get logged in the system logs. You can refer to the Logs for more information. The default value is Ignore.
In Result Key, you can assign a name to the result that you receive in response to the request. It is recommended to configure the result key to make future references of the same response easy and traceable. The default value is httpResponse.
Token Renewal Support
The collector and processor functions support token renewal, if the servers return a 401 Token Expiry error.
Response Headers
The support for response headers can be enabled by toggling the Enable response headers option. A default value for the key will be added by the engine (httpResponseHeaders) which will match the placeholder for the key input. Configuration is done by filling up the necessary input fields: Result Header Key and a Result Key.
HTTP Response Headers Support
By enabling response headers, the overall data size of the HTTP packets will also increase. Caching of the body checkbox is tied to the headers.
This option is available only for the HTTP Client collector and the HTTP Client Processor.
HTTP Client Collector
The HTTP Client collector function collects data from a third-party HTTP server.
To configure this function, take the following steps in addition to the ones mentioned in the General Settings and Advanced Settings:
In Request run limit, specify the number of times the operation should run.
HTTP Client Processor
The HTTP Client processor function processes the data received from a third-party HTTP server.
In addition to the steps mentioned in the General Settings and Advanced Settings, you can take the following optional steps to configure HTTP Client processor:
- Select Enable data cache if you want to store information received in response to an HTTP request in the cache. You can assign a key to the response stored in the cache. In this case, whenever you send the same HTTP request, the response is fetched from the cache. This helps in the faster turnaround time. Enter the following details:
- In Response key, assign a cache key to the response to an HTTP request. By default, it is the URL that you specify in Target URL.
- In Clear cache after, specify the duration (in seconds) after which the response is removed from the cache. The duration must be greater than zero. The default duration is 300 seconds.
Preview Function Toggle
This function is available only in the Client Processor node. Below the Advanced Settings dropdown menu, a preview function toggle (“Enable preview for this function”) can be enabled or disabled.
By default, this function will automatically send requests when the preview function is turned on, when the toggle is turned off, it will disable this functionality. When this function is off, POST attempts will not be made to the server. This protects external systems from being modified by the preview function.
This feature is available only for certain accounts.
HTTP Client Forwarder
Select this function to send data to the third-party HTTP server.
In addition to the steps mentioned in the General Settings and Advanced Settings, you can take the following optional steps to configure HTTP Client forwarder:
- In Maximum number of parallel requests, specify the maximum number of parallel requests that can be handled simultaneously.