Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!