Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16624

I got athentication error when im trying to post a request using axios api in vue.js

$
0
0

commerce website and this is my checkout.vue code when post request an authenticated error 401 and i don't know where the problem is some says its becuase axios and i should replace it with fetch api,any suggestion?

   const data={'first_name':this.first_name,'last_name':this.last_name,'eamil':this.eamil,'address':this.address,"zipcode":this.zipcode,"place":this.place,"phone":this.phone,"items":items,'stripe_token':token.id        }        await axios        .post("/api/v1/checkout/",data)        .then(response=>{            this.$store.commit("clearCart")            this.$router.push("/cart/success")        })        .catch(error=>{            this.errors.push("Something went wrong. Please try again")            console.log(error)        })        this.$store.commit('setIsLoading',false)    }

Viewing all articles
Browse latest Browse all 16624

Trending Articles



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