Skip to content

Requests

Introduction

In the Requests section of the Wized data store, you will find a list of all the requests you have created in your project, each identifiable by its name. This section allows you to manage and test the requests to ensure they execute correctly and return the expected information.

Execute Requests

To test any request, simply locate it in the list and press the "play" button. This will execute the request and display the results, making it easier to verify that the configuration and returned data are correct.

Details of Each Request

Each request includes two main pieces of information that you can use in the Function Editor to create custom logic:

Result:

  • Contains the data received in response to the request.
  • If no data is received, the result will be an empty array:
  • Includes the response headers, which you can also use in the Function Editor.

State:

Displays the different statuses of the specific request, including:

  • hasRequested: Indicates if the request has been executed before.
  • isRequesting: Indicates if the request is currently executing.
  • statusText: Text indicating the result of the request, e.g., success.
  • status: The HTTP status code returned, such as 200 for success.
  • ok: Returns true or false, indicating whether the request was successful (returns true if the HTTP code is in the range of 200-299).

Note

This result and the state data for each request are accessible in the Function Editor, where you can use them to build any type of logic that needs to interact with the data in a request, such as checking if information was received, handling errors, or conditioning the execution of other functions based on the results of a request.