Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The HTTP Client Function enables communication with a third-party HTTP server. Using it stream editors can control outgoing requests handling. This function supports REST API and also supports authentication via the OAuth 2.0 framework. The following HTTP Client Functions are available in Usage Engine:

  • Collector

  • Processor

  • Forwarder

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

The options are available under the Parameters and Configuration tabs. The Parameters tab allows you to set the values for how the HTTP Client function would behave when communication with the third-party HTTP server. The Configuration tab allows you to specify the method of communication.

The options specific to each of the 3 Functions, whether it is for Collector, Processor or Forwarder, will be mentioned in their corresponding sections at the end of this page.

Parameters

Under Parameters, you get the Connection and Operational Settings that are applicable to HTTP Client Collectors, Processors, and Forwarders. To configure this Function, take the following steps in addition to the ones mentioned in the Connection and Operational Settings.

Connection

Depending on the users' configuration, two authentication methods are available: Basic authentication and OAuth 2.0 implementation. A selectable option from the Authentication type is used to make the selection and based on that separate configuration options are available. There will be additional options in the Configuration tab for the Authentication type selected.

Option

Description

Include basic access authentication credentials

Select to add the specified username and password.

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

Operational Settings

In Operational 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 Request run limit, specify the number of times the operation should run. 

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. You can refer to the Logs for more information. The default value is Ignore.

Configuration

In the Configuration tab 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 Content*.

PUT

Replaces the 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 representations of the target resource.

Note!

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

  1. Select Body or Form and add the corresponding details in the content of the request message. You can use Variable Insertion.

  2. Expand the examples below to view samples of HTTP request messages for Body or Form:

Note!

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

 Sample of an HTTP body content message
{
"name" : "my_username",
"first-name" : "My",
"last-name" : "Username",
"display-name" : "My Username",
"email" : "user@example.test",
"active" : true
}
 Sample of an HTTP form content message
name=my_username&first-name=My&last-name=Username&display-name=My%20Username&email=user@example.test&active=true

Results

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

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.

Token Renewal Support

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


  • No labels