const { default: Axios } = require("axios");var giveMeAJoke = require("give-me-a-joke");const getjoke = async () => { try { const data1 = await Axios.get("https://icanhazdadjoke.com", { headers: { Accept: "application/json", }, }); } catch (e) { console.log(e); }};getjoke();
This is what I was trying with axios. I made the same request with fetch() and it worked fine. There are few packages I am using that are dependent on axios and every package is throwing the very same error. Help me out.
node index.js Error: Request failed with status code 503 at createError (D:\web-technology\practice\test\jokester\node_modules\axios\lib\core\createError.js:16:15) at settle (D:\web-technology\practice\test\jokester\node_modules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (D:\web-technology\practice\test\jokester\node_modules\axios\lib\adapters\http.js:236:11) at IncomingMessage.emit (node:events:406:35) at endReadableNT (node:internal/streams/readable:1329:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)