Thunder Client Support Versions Save

Thunder Client is a lightweight Rest API Client Extension for VS Code.

v2.20.0

1 week ago

Improved Loading of Node Modules

  • We have improved the loading of Node Modules from scripts #1434, #1442, #1429, #1405
  • Now you can load most of the node modules like mongodb, oracledb, node-postgres, @azure/identity etc..
  • Update CLI to v1.13.0

Load Module syntax

const oracledb = await tc.loadModule("oracledb");
console.log(oracledb);

Database Improvements

  • We are planning to split collection into multiple request files to reduce merge conflicts
  • Please let us know your feedback #1507

v2.19.5

2 weeks ago

New Features

  • Show unsaved indicator #1493
  • New API that allows setting the body in the Pre-Request script.
  • JSON File Indent Size vscode setting added
  • Update CLI to v1.12.13

Set Body From Script

  • We are introducing a new API that allows setting the body in the Pre-Request script.
// set JSON body
tc.request.setBody({
    color:"red"
  })

// set XML body
tc.request.setBody("<xml> xml_content </xml>");

// set Text body
tc.request.setBody("plain text body here");

// set Multi-part form
tc.request.setBody({
     form: [{
        name: "test",
        value: "123"
    }],
    files: [{
          name: "file1",
          value:"file_path_relative_or_absolute"
      }]
}, "formdata")

// set form-urlencoded
tc.request.setBody({
     form: [{
        name: "test",
        value: "123"
    }]
}, "formencoded")


// set GraphQL body
tc.request.setBody({
  query: `query {
      countries {
        name
      }
    }`,
  variables: {
        "data": {
          "hero": {
            "name": "R2-D2"
          }
        }
    }
}, "graphql")

// set Binary File body
tc.request.setBody("file_path/test.csv", "binary")

JSON File Indent Size vscode setting

Screenshot 2024-03-12 at 16 52 23

v2.19.4

2 weeks ago

New Features

  • Open scripting tab when click on request>tests if tests>tests tab is empty #1494
  • To save only failed request responses in an HTML report, utilize the htmlReportResponseLimit setting.

Bug Fixes

  • Unable to copy text from Chart visualization #1463
  • Authorization tokens not recognized #1496

v2.19.0

3 weeks ago

New Features

  • Better Server Sent Events (SSE) support #705, #319
  • Add Web Socket support #3, #336, #857
  • Ignore skipped flag on CLI run for --reqlist cmd #1489
  • Add a confirmation box when deleting requests #1487
  • Update CLI to v1.12.1

Bug Fixes

  • File Not Found (CLI v1.12.0, and UI v2.18.0) #1488
  • Fix Run Col Slow in CLI #1486

Web Socket & SSE Support

Screenshot 2024-03-06 at 09 55 02

v2.18.0

1 month ago

New Features

  • Autocomplete Environment variables #151, #1194
  • Allow Skip Folder Option in Run Collection #1476
  • Skip Collection option in CLI for Run ALL Collections
  • Save Active Environment selection changes to local memory #1250, #448
  • Set a field Content Type in a Multi-Part Form Request #1482
  • Enable Resource field for OAuth Password grant type #1479
  • Clear URL Autocomplete History #1484
  • Update CLI to v1.12.0

Bug Fixes

  • Error when sending request: ENOENT: no such file or directory #1483

Autocomplete Environment Variables

  • The extension will automatically complete the environment variables as you start typing {{.
Screenshot 2024-02-26 at 12 36 56

Skip Folder in Run Collection

  • Now, you can use the Skip Folder option to skip multiple requests in the Run Collection view.
Screenshot 2024-02-26 at 12 47 41

Skip Collections in Run All

  • Now, you can skip collections when running all collections from the CLI.
  • e.g tc --col all --skip "ColA,ColB"

Active Environment Selection

  • Set Active Environment selection changes to local memory using the setting. This helps to avoid creating unnecessary Source Control activity. Screenshot 2024-02-26 at 13 20 40

Set Field Content-Type

  • Set a field Content Type in a Multi-Part Form Request by appending content-type to the field names Screenshot 2024-02-24 at 17 39 52

Clear URL Autocomplete History

  • You can clear the URL autocomplete history from the Request URL field. Screenshot 2024-02-26 at 12 56 28

v2.17.5

1 month ago

New Features

  • New await tc.retryRequest() function added to tc API
  • New DNS Test command added to Command Palette.
  • DNS resolve issues fixed for localhost
  • Update CLI to v1.11.6

Bug Fixes

  • Special characters get converted incorrectly in cURL import functionality #1472
  • JSON Schema for Schemavalidation gets Error in CI #1471

Retry Request Function:

  • New await tc.retryRequest() function added suitable for retrying same request when failed
  • Use example code below for retry request in Post Request script
let incrementCount = parseInt(tc.getVar('incrementCount') || "0");
let code = tc.response.status;

if(incrementCount <= 3 && code !== 200)
{
      incrementCount = incrementCount + 1
      tc.setVar('incrementCount', incrementCount)
      console.log("retrying request", incrementCount);

      await tc.delay(incrementCount * 1000); // exponential delay of 1 secs
      await tc.retryRequest();
}
else
{
  tc.setVar('incrementCount', 0);
  console.log("reset incrementCount = 0");
}

DNS Test command

  • use DNS Test command for localhost connection issues
Screenshot 2024-02-03 at 13 22 32

v2.17.2

1 month ago

New Features

  • Thunder client save file didn't use the filename in content-disposition #1272, #1458
  • HTML Report filter Failed requests option

Html Report Filter dropdown

Screenshot 2024-01-31 at 16 07 20

v2.17.0

2 months ago

New Features

  • Add Support For Responses Visualisation (Beta) #511
  • VS Code setting for default values for Request Headers #845
  • Allow to open multiple Run Collection tabs #1410
  • Consolidate iterations in reports to one table structure. #1412
  • Option to specify number of iterations from CLI #1411

Bug Fixes

  • Response color highlighting disappears after closing and reopening the editor tab #1438
  • Duplicate IDs in JSON after duplicating requests #1435
  • OAUTH2 Access token breaks on all versions higher that 2.14.1 #1439

Response Data Visualisation (Beta)

  • Create charts or tables from response using tc.chartHTML() from the Tests tab scripting
  • When you pass data to function tc.chartHTML(templace, data), the data is available in chart_data global variable
  • The feature is in Beta, please test and let us know feedback
var template = `
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js"></script>

    <div id="output"></div>
    <script id="entry-template" type="text/x-handlebars-template">
          <div class="entry">
            <h2>{{first_name}}</h2>
            <div class="body">
              {{email}}
            </div>
          </div>
    </script>

    <script>
        var source = document.getElementById("entry-template").innerHTML;
        var template = Handlebars.compile(source);
    
        document.getElementById("output").innerHTML = template(chart_data[0]);
    </script>
`;

var data = tc.response.json.data;
tc.chartHTML(template, data);

Default Headers

  • You can now set default headers for requests using setting thunder-client.defaultHeaders
Screenshot 2024-01-03 at 16 39 43

v2.16.0

4 months ago

New Features

  • Import functions from other js files in Scripts #1401, #920
  • Skip individual requests option during collection run from Scripts #1402
  • Change default http library to Axios
  • Update CLI to v1.10.0

Bug Fixes

  • Automatically refresh the Auth token does not work. #1386

Import Functions from js files

  • Now you can import functions from other js files. Useful for code re-use and check-in to your git repo.
  • The path should be relative to workspace if you use Git-Sync, otherwise use full-path.
  • You can right click on the file and choose Copy Path or Copy Relative Path accordingly
// test-import.js file
function helloWorld(){
   return "hello world";
}

module.exports = {
  helloWorld
}
  • From request Inline script import js file using require

var {helloWorld} = require("thunder-tests/test-import.js");
var result = helloWorld();
console.log(result);
  • You can also save the path in the Environment variable, so you don't have to change the path in every request if you move the file to different folder.
var scriptPath = tc.getVar("scriptPath");
var {helloWorld} = require(scriptPath);
var result = helloWorld();
console.log(result);

Skip Request from Scripts

  • To skip request use the below function. Useful to control the execution order of the requests in Run Collection.
tc.skipRequest("requestId");

v2.15.3

4 months ago

Bug Fixes

  • Confusing icon to create activity, collection, and env variable #1391, #733
  • Connection refused for localhost #170
  • Undo / Redo is not working for german keyboard #1397, #1387
  • Performance slow on macOS #1398