Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
cancel/interupt reqeust AXIOS request

maybe it's a simple question.

I want to ask how to interrupt axios request in nuxt/vue.

this is my scenarios:

  1. I am in page Profile with a HTTP request getProfile and getFullProfile, getProfile request success resolved with but getFullProfile request not yet resolved.
  2. Move to product page, the request getFullProfile still waiting response

what i expect

  1. I am in page Profile with a HTTP request getProfile and getFullProfile, getProfile request success resolved with but getFullProfile request not yet resolved.
  2. Move to product page, the request getFullProfile interupt/cancel

I am using axios as a plugin, this is my config

// plugins/axios.js

 app.$axios.setHeader('accept-encoding', null)
    app.$axios.setHeader('Content-Type', 'application/json')
    app.$axios.setHeader('Authorization', token)
    app.$axios.onError(async error => {
        if (typeof error.response !== "undefined") {
            if (error.response.status === 401) {
                jscookie.set("fallback_url", window.$nuxt.$route.path)
                jscookie.remove('token');
                window.location.href = '/logout'
                return
            }
            return Promise.reject(error);
        } else {
            throw error
        }
    })

Thank you

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda