Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The HTTP Client function Function enables communication with a third-party HTTP server. Using it stream editors can control outgoing requests handling. This function Function supports REST API and also supports authentication via the OAuth 2.0 framework. The following HTTP Client functions 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 Functions are mentioned under in the corresponding sections:

...

  1. Select an HTTP request method from the following options:

    HTTP MethodDescription
    GETRequests data from the target server
    POSTSends data to the target server. Select either Body or Form under Content*
    PUTReplaces the current resources of the target URL with the uploaded content. Select
    either 
    either Body or Form under Content*
    PATCHUpdates partial resources of the target URL. Select either Body or Form under Content*
    DELETERemoves all current
    representation
    representations of the target resource


    Note
    titleNote!

    *The Body and Form fields are visible only for request methods POST, PUT and PATCH.

    • 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:
    Note
    titleNote!

    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’. 


    Expand
    titleSample of an HTTP body content message


    No Format
    {
    "name" : "my_username",
    "first-name" : "My",
    "last-name" : "Username",
    "display-name" : "My Username",
    "email" : "user@example.test",
    "active" : true
    }



    Expand
    titleSample of an HTTP form content message


    No Format
    name=my_username&first-name=My&last-name=Username&display-name=My%20Username&email=user@example.test&active=true



  2. In Target URL, enter the URL of the target HTTP server.  You can use Variable InsertionYou can select a combination of the following options to be included in the URL:

    OptionDescription
    Include basic access authentication credentialsSelect to add the specified username and password
    Include query string in URLSelect 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

    Functions only support application/json.


OAuth 2.0 Authorization

The HTTP Method, Target URL, and associated options are configured in the same way. When the Authentication type selection is selected as OAuth 2.0 additional options are displayed. Their configuration is mandatory to properly activate the functionFunction

It is also possible to use the Secrets Wallet functionality to apply stored credentials for the three HTTP functionsFunctions

The Use Redirect Fields checkbox allows users to toggle URL redirection using the available options. Two fields are displayed when this option is enabled – the Target URL field where the designated address is to be entered, and an optional Resource Path. 

The Configure Token section of the function Function controls the authentication token credentials. The Header Prefix field is the Authorization header placed before the access token. Based on the Grant Type selection there are two types of credentials access provided for the authentication provisions – Password and Client credentials. Each of them has a distinctive configuration option. 

...

  • Access Token URL – In this field specify the URL containing the authorization token. 
  • Client ID – In this field enter the client identifier. 
  • Client Secret – in this field enter the associated client secret. This parameter may be omitted if the client secret is an empty string. 
  • Scope – The authorization and token endpoints allow the client to specify the access request scope using this parameter. The entered value must be expressed as a list of space-delimited, case-sensitive strings. This is an optional parameter.
  • Client Authentication – This option controls the type of authentication mechanism as defined by the connecting server – Auth Header or Auth Body are available. The options are named "Send as Basic Auth Header" and "Send client credentials in body". 

Both grant-type options also include optional parameters: 

...

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 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 optionsDescription
    Ignore

    Select to ignore the error and the stream keeps on running

    Stop the streamSelect to stop the stream

    Any response with the HTTP status code as 4xx or 5xx is considered as an error.  All All errors get logged in the system logs. You can refer to the 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 resulting key to make future references of the same response easy and traceable. The default value is httpResponse.

Info
titleToken Renewal Support

The collector and processor functions Functions support token renewal, if the servers return a 401 Token Expiry error. 

...

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

Note
titleHTTP 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.

...

The HTTP Client collector function Function collects data from a third-party HTTP server.

To configure this functionFunction, take the following steps in addition to the ones mentioned in the General Settings and Advanced Settings:

...

The HTTP Client processor function Function processes the data received from a third-party HTTP server.

...

Preview Function Toggle

This function Function is available only in the Client Processor node. Below the Advanced Settings dropdown menu, a preview function toggle preview toggle (“Enable preview for this function”) can be enabled or disabled. 

By default, this function 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. 

...

HTTP Client Forwarder

Select this function Function to send data to the third-party HTTP server.

...