From ad2ad7d71190f17d5aa284af902f9693be413437 Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 23 Jul 2024 12:58:06 +0200 Subject: [PATCH] Fixed not working links and tuned formatting #74 --- src/pages/scripting/vars.mdx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pages/scripting/vars.mdx b/src/pages/scripting/vars.mdx index 07d59aa..4376444 100644 --- a/src/pages/scripting/vars.mdx +++ b/src/pages/scripting/vars.mdx @@ -1,16 +1,18 @@ -# Vars +# Vars tab -Vars allow you to set variables before request, and after you receive the response. +**Vars** tab allows you to set variables: + - before request and + - after you receive the response. -Vars are scoped within the request and cannot be accessed outside of it. +Variables are scoped within the request and cannot be accessed outside of it. > Note: Prior to v1.20.0, request vars were accessible at the collection scope, but this is no longer the case. -In the *Pre Request Variables* section, you can write any Strings, Numbers or any valid JavaScript literal. +In the **Vars** tab > **Pre Request** variables section, you can write any strings, numbers or any valid JavaScript literal. -In the *Post Response Variables* section, you can write any valid JavaScript expression. The res object is available, allowing you to declaratively parse the [response](./javascript-reference.html#response) and set variables, instead of writing scripts to do the same. +In the **Vars** tab > **Post Response** variables section, you can write any valid JavaScript expression. The `res` object is available, allowing you to declaratively parse the [response object](/scripting/response/response-object) and set variables, instead of writing scripts to do the same. -For parsing the response, you can checkout the [response query](./response-object) that allows you to easily query your response. +For parsing the response, you can checkout the [response query](/scripting/response/response-query) that allows you to easily query your response. **Example:** ![bru vars](/screenshots/vars.webp)