Skip to content

Requests

The requests section within the data store provides a centralized view of all API requests in your project. This section allows you to monitor, debug, and manually execute requests, giving you full control over their behavior and responses.

Overview

Each request is represented as a collapsible item in the list. The request name is displayed alongside three icons:

  1. Play icon: Executes the request manually.
  2. Preview icon: Opens the right panel to display request settings.
  3. Expand/collapse icon: Reveals or hides the request’s response details.

By expanding a request, you will see its current properties and state, making it easier to track execution, inspect returned data, and troubleshoot issues.


Request properties

Each request contains several key properties, dynamically updated upon execution. These are displayed in a structured format resembling a JavaScript object.

PropertyTypeDefault ValueDescription
hasRequestedBooleanfalseIndicates if the request has been executed at least once.
isRequestingBooleanfalseBecomes true while the request is in progress.
statusTextStringnullDisplays the response status text (e.g., "Success", "Forbidden", "Not Found").
statusNumbernullThe HTTP response code (e.g., 200, 404, 500).
okBooleanfalsetrue if the request was successful (200-299 status range).
dataObjectnullStores the response payload, dynamically structured based on the returned data as Key-value pairs.
headersObjectnullStores the response headers as key-value pairs.

request-overview When a request is executed, its status, response data, and headers update in real time. This provides a clear snapshot of the request’s success or failure, making it an essential tool for debugging.


Using requests values

Requests are not just for viewing responses they are fully accessible within the function editor, allowing dynamic data manipulation and logic execution.

Accessing request data

You can access request properties directly using the r parameter in the function editor.

Get a user’s name from a request

js
return r.get_user.data.name;

Render a list of products

js
return r.products_request.data.products;
// Assuming "products" is an array

Check if a request was successful

js
return r.login.ok ? 'Login successful' : 'Login failed';

Debugging requests

Since request states are visible in real time, you can:

  • Identify errors by checking the statusText and status properties.
  • Verify successful execution using the ok boolean.
  • Inspect the returned payload in the data object.