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.
-
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.
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.
Lists
Twidget offers a variety of commands to help you manipulate lists easily without coding. Below is a detailed explanation of each command available. Get. Description: Returns the element in the provided list at the given index. Inputs: - `list`: The list from which to get the element. - `index`: The ...
Database
Twidget offers many commands to manage data in your database. Below is a list of the available commands and their functionalities: Get Data. Retrieve an entry from a table. Get Multiple Data. Retrieve multiple entries from a table. Save Data. Save an object to a database table. Save Multiple Data. S...
Connector Commands
Connector Commands allow you to integrate Twidget projects with external services such as Google Drive, Slack, OpenAI’s ChatGPT, and many others. These commands provide ready-made actions that communicate with third-party APIs, removing the need to manually create and maintain external HTTP requests...
Error Handling
When building applications with Twidget, you may encounter situations where you need to handle errors gracefully to ensure your application runs smoothly. Twidget provides two powerful commands for error handling: `try-catch` and `throw-error`. This documentation will guide you on how to use these c...
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...