HTTP Client (Processor)
The HTTP Client processor function processes the data received from a third-party HTTP server. You can configure this function to set the values for how the HTTP Client function would behave when communicating with the third-party HTTP server, and specify the method of communication.
You can configure this function in the following settings:
Connection
Depending on your configuration, three authentication methods are available: None, Basic authentication and OAuth 2.0.
When you select an Authentication type, there will be separate configuration options for the selected authentication type.
Cache settings
Toggle on Enable 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 allows for 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.
Operational settings
In Operational settings, enter the following details that determine how you want the function to behave.
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 4xx or 5xx is considered an error. All errors get logged in the system logs. See Logs for more information.
The default value is Ignore.
General settings
In General settings, you select an HTTP request method from the following options:
HTTP Method | Description |
---|---|
GET | Request data from the target server. |
POST | Sends data to the target server. Select either Body or Form under Contents*. |
PUT | Replaces the current resources of the target URL with the uploaded content. Select either Body or Form under Contents*. |
PATCH | Updates partial resources of the target URL. Select either Body or Form under Contents*. |
DELETE | Removes all current representations of the target resource. |
Note!
*The Body and Form fields are visible only for the POST, PUT and PATCH request methods. See Contents for more information.
You can select a combination of the following options to be included:
Option | Description |
---|---|
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 the HTTP header “content-type.” It is recommended that the default value for the HTTP header “accept” is left unchanged. The HTTP functions only support application/json. |
Results
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 resulting key to make future references of the same response easy and traceable. The default value is httpResponse.
The support for response headers can be enabled by toggling on the Enable response headers option. A default value for the Result headers Key will be added by the engine (httpResponseHeaders) which will match the placeholder for the key input.
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 collector and the processor.
Token Renewal Support
The collector and processor Functions support token renewal, if the servers return a 401 Token Expiry error.
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.