I have the following code, which is run from a express server:
import fetch from \'node-fetch\';
let formBody = [];
const dataLogin = {
\'username\': \'
The other way to do is to set your own agent to the fetch call.
const fetch = require('node-fetch');
const https = require('https');
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
});
const response = await fetch(url, {
method: 'POST',
headers: headers,
body: body,
agent: httpsAgent,
});