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

AI connectors

For every command’s inputs, results, examples and common errors, open the [detailed connector reference](/docs/connectors/overview). The command editor’s help button opens its exact reference section. Use an AI provider from an endpoint, server function or event. Choose your organization's connector...

Text

Twidget offers a variety of commands to manipulate text in various ways. To Uppercase. Converts all characters of the provided text to uppercase. - text: The text to be converted to uppercase. - A text string with all characters in uppercase. To Lowercase. Converts all characters of the provided tex...

Return

The `return` command in Twidget is a special command used to halt the current command workflow and immediately return a specified result. This command overrides any subsequent processes and outputs the return result regardless of the rest of the workflow logic. This command is particularly useful fo...

Cryptography commands

Create checksums, protect text with encryption, sign and verify messages, and compare private text in endpoints, server functions and events. Find these commands under Security when adding a command. They use the familiar variable selector and Return as field. Keep shared signing keys in [Globals & ...

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