[Vuejs]-Is it possible to set timout in Axios get request?

0👍

Axios timeout is responsible for response timeout. If you want to wait for the data for about 30 seconds, you can use a Promise to wait for about 30 seconds.

async function getData() {
   const data = await this.$http.get(stringUrl, {parameters: {limit: 5000}},timeout: 30000)
   return new Promise(res =>  setTimeout(res(data), 30000))
}

Leave a comment