Florence Boulanger
Florence Boulanger

Reputation: 21

insomnia – v9.2.0 : pre request script use external library

In pre request script , i need to user some external libraries as fs or forge

const x = require('forge') (or node-forge)  

does not work . This

Based on what I found on the internet, I do this:


insomnia.sendRequest("https://cdnjs.cloudflare.com/ajax/libs/forge/1.3.1/forge.min.js", (err, res) => {

// insomnia.globals.set("forgeJS", res.text());
if (err) {
console.log('rrrrrrrrr' + err.text());
} else {
console.log('ghghghghghgh' + err.text());
insomnia.baseEnvironment.set("forgeJS", res.text());

}
})

I have a timeout for the get whereas if I type the same url in a browser , I get a very fast response (test with and without vpn) (in insomnia config , i have not proxy)

how i can call this kind of lib in insomnia ?

thx for your help

how i can call this kind of lib in insomnia ?

Upvotes: 1

Views: 281

Answers (0)

Related Questions