From 787ac756f21293d5b8e1dbe2304c687256262b06 Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Fri, 14 Nov 2025 07:41:59 +0000
Subject: [PATCH 1/3] Update general/api-client/scripts.mdx
---
general/api-client/scripts.mdx | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/general/api-client/scripts.mdx b/general/api-client/scripts.mdx
index 2a60573..18d1bba 100644
--- a/general/api-client/scripts.mdx
+++ b/general/api-client/scripts.mdx
@@ -16,6 +16,35 @@ Scripts in Requestly allow you to extend and customize your API requests and res
+## **Console Log Filtering**
+
+All console logs generated from your scripts are automatically prefixed with `#script` to help you easily identify and filter script-related logs in the browser console. This makes debugging and monitoring your scripts more efficient.
+
+**Example:**
+
+When you use `console.log()` in your script:
+
+```jsx
+console.log("Request sent successfully");
+console.error("An error occurred");
+```
+
+The output in the browser console will appear as:
+
+```
+#script Request sent successfully
+#script An error occurred
+```
+
+**Filtering Logs:**
+
+To view only script-related logs in your browser console, use the filter feature:
+- Open the browser DevTools console
+- Type `#script` in the filter box
+- Only logs from your API client scripts will be displayed
+
+This prefix is applied to all console methods including `log`, `error`, `warn`, `info`, `debug`, and `trace`.
+
## **Pre-Request Scripts**
**Pre-Request Scripts** run before the API request is sent to the server. They allow you to modify request attributes, such as headers, body, query parameters, or even the URL. Pre Scripts are useful for adding authentication tokens, generating timestamps, or altering the request dynamically based on certain conditions.
From f2686b8d6c73c0d13127fed26a250e16751b948f Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Fri, 14 Nov 2025 07:52:21 +0000
Subject: [PATCH 2/3] Update general/api-client/scripts.mdx
---
general/api-client/scripts.mdx | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/general/api-client/scripts.mdx b/general/api-client/scripts.mdx
index 18d1bba..2a60573 100644
--- a/general/api-client/scripts.mdx
+++ b/general/api-client/scripts.mdx
@@ -16,35 +16,6 @@ Scripts in Requestly allow you to extend and customize your API requests and res
-## **Console Log Filtering**
-
-All console logs generated from your scripts are automatically prefixed with `#script` to help you easily identify and filter script-related logs in the browser console. This makes debugging and monitoring your scripts more efficient.
-
-**Example:**
-
-When you use `console.log()` in your script:
-
-```jsx
-console.log("Request sent successfully");
-console.error("An error occurred");
-```
-
-The output in the browser console will appear as:
-
-```
-#script Request sent successfully
-#script An error occurred
-```
-
-**Filtering Logs:**
-
-To view only script-related logs in your browser console, use the filter feature:
-- Open the browser DevTools console
-- Type `#script` in the filter box
-- Only logs from your API client scripts will be displayed
-
-This prefix is applied to all console methods including `log`, `error`, `warn`, `info`, `debug`, and `trace`.
-
## **Pre-Request Scripts**
**Pre-Request Scripts** run before the API request is sent to the server. They allow you to modify request attributes, such as headers, body, query parameters, or even the URL. Pre Scripts are useful for adding authentication tokens, generating timestamps, or altering the request dynamically based on certain conditions.
From 02226f6def77340d67b4043d14e22b28ec53cd6e Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Fri, 14 Nov 2025 07:53:11 +0000
Subject: [PATCH 3/3] Update general/api-client/scripts.mdx
---
general/api-client/scripts.mdx | 45 ++++++++++++++++++++++++++++------
1 file changed, 37 insertions(+), 8 deletions(-)
diff --git a/general/api-client/scripts.mdx b/general/api-client/scripts.mdx
index 2a60573..5ee974d 100644
--- a/general/api-client/scripts.mdx
+++ b/general/api-client/scripts.mdx
@@ -22,11 +22,11 @@ Scripts in Requestly allow you to extend and customize your API requests and res
-Let’s try to understand the workings of pre-script using easy-to-follow examples.
+Let's try to understand the workings of pre-script using easy-to-follow examples.
**Auto Increment Page Numbers**
-Let’s assume you have an endpoint that takes page number as query parameter, we use environment variable `{{page_number}}` to get value of page number.
+Let's assume you have an endpoint that takes page number as query parameter, we use environment variable `{{page_number}}` to get value of page number.
```json
https://app.requestly.io/echo?page={{page_number}}
@@ -44,7 +44,7 @@ Now every time you click the Send button of this request it would send increment
During development hitting an API with new data every time can be a pain, we can use Pre-Script to randomise the values and call the same API without getting duplicate entry error.
-Let’s setup our request with body as follows:
+Let's setup our request with body as follows:
```json
POST:
@@ -70,7 +70,7 @@ rq.environment.set("phone_number", phone);
You can also use pre-script to generate access tokens, validate the requests, generate some random data for the request.
-You can also access elements of the request, collection variables and environment variables, checkout Requestly’s JavaScript API.
+You can also access elements of the request, collection variables and environment variables, checkout Requestly's JavaScript API.
## **Post-Response Scripts**
@@ -78,7 +78,7 @@ You can also access elements of the request, collection variables and environmen
-Let’s try to understand the working of post script using easy to follow examples.
+Let's try to understand the working of post script using easy to follow examples.
**Validate Response Code**
@@ -90,7 +90,36 @@ if (rq.response.code !== 200) {
We can also fetch and set API Keys or auth tokens, id, and other data from response of an API and use it in other APIs.
-You can access elements of the request, response, collection variables and environment variables, checkout Requestly’s JavaScript API.
+You can access elements of the request, response, collection variables and environment variables, checkout Requestly's JavaScript API.
+
+## **Console Log Filtering**
+
+All console logs generated from your scripts are automatically prefixed with `#script` to help you easily identify and filter script-related logs in the browser console. This makes debugging and monitoring your scripts more efficient.
+
+**Example:**
+
+When you use `console.log()` in your script:
+
+```jsx
+console.log("Request sent successfully");
+console.error("An error occurred");
+```
+
+The output in the browser console will appear as:
+
+```
+#script Request sent successfully
+#script An error occurred
+```
+
+**Filtering Logs:**
+
+To view only script-related logs in your browser console, use the filter feature:
+- Open the browser DevTools console
+- Type `#script` in the filter box
+- Only logs from your API client scripts will be displayed
+
+This prefix is applied to all console methods including `log`, `error`, `warn`, `info`, `debug`, and `trace`.
***
@@ -104,7 +133,7 @@ These properties and methods let you access the details of the API request in sc
`rq.request.method`
-Use this property to get the Request’s method. The HTTP method of the request (e.g. `GET`, `POST`, `PUT`, `OPTION`, `DELETE`, `PATCH`, `HEAD`).
+Use this property to get the Request's method. The HTTP method of the request (e.g. `GET`, `POST`, `PUT`, `OPTION`, `DELETE`, `PATCH`, `HEAD`).
**Example:**
@@ -156,7 +185,7 @@ console.log("Query Params:", JSON.stringify(rq.request.queryParams));
### **Response Object** `rq.response`
-These properties and methods let you access the details of the API’s response in scripts.
+These properties and methods let you access the details of the API's response in scripts.
`rq.response.body`