Skip to main content

HTTP connector

Performs HTTP requests to any service or API.

component image

In-ports

url String — HTTP request URL.

params Array, Object — parameters to be added to the request URL. See HTTP Request Parameters for more details.

data JSON, String — HTTP request body. Required only for POST, PUT and PATCH methods.

headers JSON — HTTP request headers.

trigger <any> — triggers an HTTP request. If the port is not connected, the request is made on the event at the url port.

abort Boolean — aborts all pending requests.

Out-ports

response JSON, Signal — emits a response wrapped into JSON object, or an error signal, in case the request failed.

error JSON — if an error occurs, emits a JSON object with the request details and an error cause.

Overview

The HTTP Component allows you to send HTTP requests to any web service or API. It establishes a secure connection with the Kelp Data Gateway service, which is used to make all requests to the target service. Therefore, requests to the target service are not made directly from your browser, but from the secure Kelp Data Gateway backend service.

To use this component, you need to send the request URL to the url port, and other optional attributes to the params, data, and headers ports. The component will return the response from the service, wrap it into a JSON object, and emit it on the response port.

Params

By default, the values from the params port are appended as query parameters in the URL. The port accepts input parameters as an array or an object. You can also specify parameter placeholders in the path and query parts of the URL by enabling the “Path parameters” setting. These placeholders are then replaced with values from the params port first. The remaining values will be appended as query parameters. Parameters defined in the URL placeholders are considered mandatory by default, unless you specify the * (zero or more) quantifier. Learn more about how to use HTTP Request Parameters.

Order of Invocation

The URL attribute is a required attribute for the HTTP request. If there is no event on the url port, the request will not be sent. You can use the params, data, and headers ports to provide other optional attributes.

After initializing the HTTP connector, it will wait for the first event on all connected input ports (ports with a connected wire) before triggering the request. Subsequent events on any input port will fire a new request.

If the trigger port is connected, the connector will wait to fire the request until an event is received on the trigger port. The connector will then fire the request every time an event is received on the trigger port. To control the order of updates on input ports and firing the request, you can use a Fork component in combination with the trigger port.

If any errors occur during the request execution, the corresponding error message will be emitted on the errors output port.

Authentication

To make authorized requests, you can specify the integration and credentials using the Authentication setting. In order to keep your credentials secure, Kelp encrypts and stores them in a protected cloud vault when you configure an integration with the target service. When your app is making HTTP requests, no actual credentials are included, but instead, a reference to the credentials stored in the vault is used. This ensures that the credentials are never stored in the app or intercepted during transfer.

Settings

Authentication

Configure authentication for the target service. Choose an existing connection from the drop-down list or set up a new connection. Alternatively, you can leave it as the default "No Auth" setting if authentication is not required for the service.

Path parameter processing

Sets the method for processing parameters in the URL. For more details and additional examples, refer to the HTTP Request Parameters documentation.

Type: String
Required: No
Default: path-params

  • None (none) — No parameters in the URL path. Instead, all values on the params port will be added as URL query arguments.
  • Path parameters (path-params) — Values for path parameters are enclosed in curly brackets { }.

Request Method

HTTP request method type.

Type: String
Required: Yes
Default: GET

  • GET (get) - requests a representation of the specified resource. Requests using GET should only retrieve data.
  • HEAD (head) - asks for a response identical to a GET request, but without the response body.
  • POST (post) - submits an entity to the specified resource, often causing a change in state or side effects on the server.
  • PUT (put) - replaces all current representations of the target resource with the request payload.
  • PATCH (patch) - applies partial modifications to a resource.
  • DELETE (delete) - deletes the specified resource.

Response Data Type

Sets the response data type (not applicable for the HEAD request method). The corresponding header parameters will be added to the HTTP request automatically.

Type: String
Required: No
Default: JSON

  • JSON (json) - request result will be parsed and output as JSON. The connector will output null if the result can not be parsed as JSON.
  • Array buffer (arrayBuffer) - use this type to obtain binary data as an array of bytes. Refer Array Buffer for more information. Some transformations can be performed on Array buffer data. For instance, you can convert it into a base64 string using the KelpQL base64_encode function.
  • Blob (blob) - use this output type to retrieve binary data. Refer to the Blob article for more information.
  • Text (text) - output result as string.

Timeout

Sets the request timeout in milliseconds. The request is aborted if the response is not returned within the timeout. A value of 0 indicates no timeout value, which is also the default.

Keep always active

Determines whether the component will remain active even if it is not connected to a visible widget or another active component.

Learn More