Thunder Client is a lightweight Rest API Client Extension for VS Code.
private
modules or modules hosted on registries other than npm.var moment = tc.loadFromPath("thunder-tests/packages/node_modules/moment");
loading of Node Modules
from scripts #1434, #1442, #1429, #1405mongodb
, oracledb
, node-postgres
, @azure/identity
etc..v1.13.0
Load Module syntax
const oracledb = await tc.loadModule("oracledb");
console.log(oracledb);
split
collection into multiple request files to reduce merge conflictsunsaved
indicator #1493setting the body
in the Pre-Request script.JSON File Indent Size
vscode setting addedv1.12.13
tc.request.setBody({
color:"red"
});
Server Sent Events (SSE)
support #705, #319Web Socket
support #3, #336, #857--reqlist
cmd #1489v1.12.1
Autocomplete
Environment variables #151, #1194Skip Folder
Option in Run Collection #1476Skip Collection
option in CLI for Run ALL CollectionsActive Environment
selection changes to local memory
#1250, #448field Content Type
in a Multi-Part Form Request #1482v1.12.0
{{
.Skip Folder
option to skip multiple requests in the Run Collection view.tc --col all --skip "ColA,ColB"
Active Environment
selection changes to local memory
using the setting. This helps to avoid creating unnecessary Source Control activity.
content-type
to the field names
Request URL
field.
await tc.retryRequest()
function added to tc
APIDNS Test
command added to Command Palette.v1.11.6
await tc.retryRequest()
function added suitable for retrying same request when failedPost 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 for localhost connection issuesResponses Visualisation
(Beta) #511default values for Request Headers
#845tc.chartHTML()
from the Tests tab scriptingtc.chartHTML(templace, data)
, the data is available in chart_data
global variablevar 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);
thunder-client.defaultHeaders