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

why making a get request with axios failing with status code 503? [closed]

$
0
0
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)

Viewing all articles
Browse latest Browse all 1580

Trending Articles



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