Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1792

axios-cookiejar-support does not support for use with other http(s).Agent

$
0
0

My code is

const axios = require('axios')const https = require('https');const axiosCookieJarSupport = require("axios-cookiejar-support");const tough = require("tough-cookie");const HEADERS = {'Content-Type': 'application/json; odata.streaming=true; charset=utf-8',    Accept: 'application/json; odata.metadata=none, text/plain','TM1-SessionContext': '----','User-Agent': '----'  }this.http = axios.create({   headers: HEADERS,   withCredentials: true,   httpsAgent: new https.Agent({ rejectUnauthorized: false })})axiosCookieJarSupport.wrapper(this.http)this.http.defaults.jar = new tough.CookieJar()this.http.defaults.baseURL = this.baseUrl// Then other things but that doesn't matter

But when i run that i got this error :

Error: axios-cookiejar-support does not support for use with other http(s).Agent.    at requestInterceptor (C:\node_modules\axios-cookiejar-support\dist\index.js:14:15)    at processTicksAndRejections (node:internal/process/task_queues:96:5)    at async RestService.startSession (C:\main.js:109:29)

I guess the problem come from the https agent initialized with https.Agent({})

Maybe it exist the same constructor from axios lib but i didn't find it

Thanks by advance


Viewing all articles
Browse latest Browse all 1792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>