Sign Up
Loading...

Send External HTTP Request

Watch the walkthrough

HTTP Request Command

Call an external HTTP API from a workflow and use the response.

Recorded with an earlier Twidget interface. Names, control locations and available options may differ; use the linked documentation for current guidance.

Watch tutorial (3:00)

Browse all video tutorials

Using Twidget, you can send external HTTP requests effortlessly. This functionality allows you to communicate with external servers or APIs. Below, you will find the necessary parameters and structure to set up an HTTP request.

Parameters

  • URL: The endpoint to which the request will be sent.

  • Method: The HTTP method (GET, POST, PUT, DELETE, etc.).

  • Parameters: Key-value pairs appended to the URL in the format key=value.

  • Headers: Metadata sent with the request, structured as key-value pairs.

  • Body: Data sent with the request. Applicable for methods like POST and PUT.

  • Timeout: The duration before the request times out, specified in seconds.

Import a request example

If a service provides a cURL example, open the request editor and select Import cURL. Paste the example into cURL command, then select Import into request.

This credential-free example imports a POST request with a query parameter and a small JSON body.

After import, the URL, POST method and limit query parameter appear in their corresponding editor fields.

Review the imported URL, method, parameters, headers and body before saving. Import fills the editor without sending the request. It replaces those request fields while keeping the selected account, response type and return name. The timeout is kept unless the example supplies a maximum time.

Use a standard quoted example rather than a script or a file upload command. Unsupported examples show an error. Remove real passwords or tokens from examples before sharing them, and choose your configured credentials when preparing the request.

Response Structure

The response of the request will be stored as a variable with the following schema:


{

  "status": number,

  "status_text": text,

  "headers": {object},

  "data": {object}

}
  • status: The HTTP status code returned by the server.

  • status_text: Textual representation of the HTTP status code.

  • headers: Headers returned in the response.

  • data: The body of the response, usually in JSON format.

By following the structure and examples provided, you can easily configure and send HTTP requests using Twidget, as well as handle and process the responses.

Related Topics

Realtime commands

Use these commands in endpoints, server functions and events to connect authenticated customers and send live notifications. Start with [Realtime channels](/docs/builder/realtime) to create a channel and choose its audience. Authorize Realtime. Issue a one-use connection ticket for the signed-in cus...

Advanced file commands

Prepare CSV downloads, work with small ZIP archives and share a temporary download link from an endpoint, server function or event. Find these commands under File Manager when adding a command. Use the usual variable selector and Return as field. The existing file commands still handle storage, fold...

Managing Files

Twidget offers a set of commands to manipulate files in your file store. Below are the descriptions and usage of each command to help you understand how to utilize them effectively. For CSV, ZIP archives and temporary download links, see [Advanced file commands](/docs/commands/advanced-files). Get F...

Local Storage

Twidget provides a set of local storage commands that enable interaction with the browser’s `localStorage` API through a no-code interface. These commands are useful for storing, retrieving, and managing key-value data persistently within the current domain context. Purpose. These commands abstract ...

Security

Twidget provides several built-in functions to enhance the security of your applications. Below is an overview of each security command, including its description, inputs, and outputs. For checksums, shared-secret signatures, webhook verification and safe text comparison, see [Cryptography commands]...